Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on Windows XP #12

Open
Dimsok opened this issue Sep 13, 2017 · 7 comments
Open

Doesn't work on Windows XP #12

Dimsok opened this issue Sep 13, 2017 · 7 comments

Comments

@Dimsok
Copy link

Dimsok commented Sep 13, 2017

I have Ruby 1.8. 7 on win XP installed, and it doesn't work at all for me. Everytime it's just says "invalid option -U (-h will show valid options) and nothing more with any switches.

@dohliam
Copy link
Owner

dohliam commented Sep 14, 2017

Hi Dimsok, thanks for reporting this. Ruby 1.8.7 was released in 2008 and is no longer supported or maintained by the Ruby developers. Versions as early as 1.9.3 seem to be working fine. Are you able to test this out on a newer version of Ruby (or Windows) to see if it works there?

@dohliam dohliam changed the title Doesn't work on windows Doesn't work on Windows XP Sep 14, 2017
@Dimsok
Copy link
Author

Dimsok commented Sep 14, 2017

I can't use latest version cause of XP. I did try ruby-1.9.3-p551-i386-mingw32, make install nokogiri, but it shows some error, Maybe it's because that i tried it in portable mode or not installed all needed components as listing in script.
I almost not used ruby, just for one program which worked on old version, so maybe a stupid question: how can i install zlib, fileutils etc for old version of ruby? I have installed gem and try to find gems for needed components on rugems.org, but mostly gems only for ruby 2.5 and don't have old version. Or all these not really necessary?

require 'yaml'
require 'fileutils'
require 'zlib'
require 'optparse'
require 'nokogiri'
require 'open-uri'

@dohliam
Copy link
Owner

dohliam commented Sep 14, 2017

Yes, you definitely need all of the required gems or the script won't work at all. For example, without zlib you won't have any way of opening the .dict.dz files to search inside of them.

@Dimsok
Copy link
Author

Dimsok commented Oct 4, 2017

Ok, i made it works, but still can't use cause of 2 reasons:

  1. The default way "c:\Documents and Settings\Administrator.goldendict" is works but when i try to set :dict_dir: "H:\Progam files\GoldenDict\content\dicts", i get:
    C:/Program Files/Ruby/lib/ruby/1.9.1/psych.rb:203:in parse': (<unknown>): fou unknown escape character while parsing a quoted scalar at line 15 column 12 ( ych::SyntaxError) from C:/Program Files/Ruby/lib/ruby/1.9.1/psych.rb:203:in parse_strea

     from C:/Program Files/Ruby/lib/ruby/1.9.1/psych.rb:151:in `parse'
     from C:/Program Files/Ruby/lib/ruby/1.9.1/psych.rb:127:in `load'
     from C:/33/gdcl-master/gdcl.rb:26:in `<main>'
    
  2. When i try to search words with cyrillic, i get:
    C:\Documents and Settings\Administrator.goldendict\dic\en>C:\33\gdcl-master\gdc
    l.rb en аберрациия
    C:/33/gdcl-master/gdcl.rb:239:in sub': incompatible encoding regexp match (UTF- 8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError) from C:/33/gdcl-master/gdcl.rb:239:in block in

    '
    from C:/33/gdcl-master/gdcl.rb:238:in each' from C:/33/gdcl-master/gdcl.rb:238:in '

Is there a way to resolve it?

@dohliam
Copy link
Owner

dohliam commented Oct 4, 2017

Your problem 1. is because you were using Windows "\" characters to separate your file path (which Ruby interprets as escapes), rather than "/". Ruby uses "/" to separate paths, regardless of the OS you are using. You should be able to figure out how to fix it using the information in the StackOverflow link.

Your problem 2. may just come down to the fact that you are using XP. Are you sure that XP supports UTF-8?

@Dimsok
Copy link
Author

Dimsok commented Oct 4, 2017

Of course it supports utf8. Or are you talking about command line? I can see chinese characters etc, but not in command line. If so. is there a way to use ansi 1251 instead of utf8?

@Dimsok
Copy link
Author

Dimsok commented Oct 4, 2017

The first was resolved, the second no after i did try chcp 65001 in cmd.
By the way, is there a way to use it portable? I mean always store config.yml in folder of gdcl.rb and not copy it to .config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants