gdcl icon indicating copy to clipboard operation
gdcl copied to clipboard

Doesn't work on Windows XP

Open Dimsok opened this issue 7 years ago • 7 comments

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.

Dimsok avatar Sep 13 '17 13:09 Dimsok

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 avatar Sep 14 '17 01:09 dohliam

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'

Dimsok avatar Sep 14 '17 04:09 Dimsok

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.

dohliam avatar Sep 14 '17 17:09 dohliam

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?

Dimsok avatar Oct 04 '17 01:10 Dimsok

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?

dohliam avatar Oct 04 '17 04:10 dohliam

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 avatar Oct 04 '17 20:10 Dimsok

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.

Dimsok avatar Oct 04 '17 21:10 Dimsok