postmodern / chruby

Changes the current Ruby
MIT License
2.87k stars 190 forks source link

json-1.8.3 json ext uses system ruby (libruby.2.0.0.dylib) #344

Closed globalkeith closed 9 years ago

globalkeith commented 9 years ago

Hi,

I'm not sure what more information you'll need but I'll try to keep my laptop state so I can re-create this. It seems that when json requests its external lib to parse data require 'json/ext/parser' It uses the system ruby, which is version 2.0.0, rather than the chruby/ruby-install preferred 2.2.2.

https://bugs.ruby-lang.org/issues/11421

postmodern commented 9 years ago

I could not reproduce this problem:

$ chruby ruby-2.2.2
$ gem install json
Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.3
Parsing documentation for json-1.8.3
Installing ri documentation for json-1.8.3
Done installing documentation for json after 1 seconds
1 gem installed
$ \irb
>> require 'json/ext/parser'
=> true
>> $LOADED_FEATURES.last
"/home/hal/.gem/ruby/2.2.2/extensions/x86_64-linux/2.2.0-static/json-1.8.3/json/ext/parser.so"

Can you provide a minimal reproduction script, of how you installed everything. I'm guessing that somehow bundler is mixing ruby-2.0 with ruby-2.2. You might want to check head -n 1 $(which bundle) and ensure that the #! points to ruby-2.2.2.

globalkeith commented 9 years ago

Sorry I was on a tight deadline so I wasn't able to leave it broken, I ended up manually deleting all gems and rubies and, reinstalling with my json version locked back down at 1.8.1, which seemed to stop the seg fault. Now, as luck would have it I just tried updating to 1.8.3 and I no longer get the error either. I'm sorry I can't provide any further information on how it was created. If it happens again or I manage to find more time to investigate I will let you know. Sorry I can't be of more help this time.

On 11 August 2015 at 18:48, Postmodern notifications@github.com wrote:

I could not reproduce this problem:

$ chruby ruby-2.2.2 $ gem install json Fetching: json-1.8.3.gem (100%) Building native extensions. This could take a while... Successfully installed json-1.8.3 Parsing documentation for json-1.8.3 Installing ri documentation for json-1.8.3 Done installing documentation for json after 1 seconds 1 gem installed $ \irb

require 'json/ext/parser' => true $LOADED_FEATURES.last "/home/hal/.gem/ruby/2.2.2/extensions/x86_64-linux/2.2.0-static/json-1.8.3/json/ext/parser.so"

Can you provide a minimal reproduction script, of how you installed everything. I'm guessing that somehow bundler is mixing ruby-2.0 with ruby-2.2. You might want to check head -n 1 $(which bundle) and ensure that the #! points to ruby-2.2.2.

— Reply to this email directly or view it on GitHub https://github.com/postmodern/chruby/issues/344#issuecomment-129989389.

postmodern commented 9 years ago

Closing this. Guessing it was a rubygems #! issue.