Closed atomotic closed 12 years ago
I tried your code example (under ruby 1.9.3, if it matters) and didn't have a problem. Can you help us reproduce the problem?
i tried again with a fresh user and an empty ruby install from rvm, on osx 10.6, and fails. it works fine on linux
➜ gem env RubyGems Environment:
➜ gem list
* LOCAL GEMS *
builder (3.0.0) faraday (0.8.1) faraday_middleware (0.8.8) multipart-post (1.1.5) oai (0.1.0) rake (0.8.7)
I tried your code snippet under ruby 1.9.2 and those gems and it still worked for me.
@atomotic Did you install libxml-ruby gem? I had the same error, but after installing libxml-ruby it worked for me.
@nabeta: yes, i tried also with and without libxml-ruby.
the problem i think is something in my ENV. if i set
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG=C
the error returned:
/Users/void/.rvm/gems/ruby-1.9.2-p0@oai/gems/oai-0.1.0/lib/oai/client.rb:293:in `gsub': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) (Encoding::CompatibilityError)
from /Users/void/.rvm/gems/ruby-1.9.2-p0@oai/gems/oai-0.1.0/lib/oai/client.rb:293:in `strip_invalid_utf_8_chars'
from /Users/void/.rvm/gems/ruby-1.9.2-p0@oai/gems/oai-0.1.0/lib/oai/client.rb:175:in `do_request'
from /Users/void/.rvm/gems/ruby-1.9.2-p0@oai/gems/oai-0.1.0/lib/oai/client.rb:144:in `get_record'
from ./get-record.rb:7:in `<main>'
under linux everything works.
switching to 1.9.3 solved everything.
after upgrading the gem to latest 0.1.0 i got this error for get_record() o list_records()
a code example