3

I used RVM to upgrade Ruby 1.9.2 from patch level p180 to p290:

rvm upgrade 1.9.2-p180 1.9.2-p290

Then, I used these commands to update my Rails gem and other gems

gem install rails 3.0.5
gem update

Everything seems to be fine; rvm info shows all Ruby binaries and gems have been moved to the correct p290 path (~/.rvm/*/ruby-1.9.2-p290/*).

However, when I go to my Rails application directory and issue the command rails console, I get the error message saying a gem (activesupport-3.0.5) cannot load the libruby.1.9.1.dylib file.

10:30 AM ~/Development/rails_projects/my_app_0515 $ rails console

/Users/whk/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': dlopen(/Users/whk/.rvm/gems/ruby-1.9.2-p290/gems/serialport-1.0.4/lib/serialport.bundle, 9): Library not loaded: /Users/whk/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.1.9.1.dylib (LoadError) Referenced from: /Users/whk/.rvm/gems/ruby-1.9.2-p290/gems/serialport-1.0.4/lib/serialport.bundle Reason: image not found - /Users/whk/.rvm/gems/ruby-1.9.2-p290/gems/serialport-1.0.4/lib/serialport.bundle . . .

Rails can't find the dylib file in ~/.rvm/rubies/ruby-1.9.2-p180/lib, because the p180 path no longer exists, but the file is in ~/.rvm/rubies/ruby-1.9.2-p290/lib.

From a separate StackOverflow post, I found a workaround is adding this line to .bashrc

export DYLD_LIBRARY_PATH="/Users/whk/.rvm/rubies/ruby-1.9.2-p290/lib:$DYLD_LIBRARY_PATH"

However, I want to understand why the rvm ruby upgrade doesn't take care of the lib path change? Does anyone know a cleaner solution -- one that removes the p180 path from where it is configured?

Here are my environment:

  • Mac OS X 10.6.6 (Snow Leopard)
  • rvm 1.8.4
  • ruby 1.9.2p290
  • Rails 3.0.5

Thanks!

Community
  • 1
  • 1
Karen W
  • 269
  • 2
  • 11
  • I have had a generally negative experience with p290. Many gems won't install etc. I actually am specifying `rvm 1.9.2-p180@some_gemset` for now. – providence Sep 28 '11 at 18:29

1 Answers1

0

the problem was in gems native extension - their were nto rebuild during rvm upgrade 1.9.2-p180 1.9.2-p290 - next time please have closer look on the output ... it should give your information what's wrong.

as for this particular use case it shoudl be enough to reinstall the given gem:

gem install serialport -v 1.0.4

... not sure if it should be uninstalled first

mpapis
  • 52,729
  • 14
  • 121
  • 158
  • Thanks for the suggestion! I had tried it, and unfortunately it didn't work. I uncommented the workaround I had in .bashrc, uninstalled and re-installed the serialport gem successfully, and tried rails conole again. I saw the same error. – Karen W Feb 07 '12 at 20:53
  • it still feels like the same issue, have you tried on empty ruby, with new name? `rvm install 1.9.3-named` and use it `rvm use 1.9.3-named` – mpapis Feb 08 '12 at 20:49
  • No, I haven't tried. I don't want to tamper with the current working setup where I'm doing active development. In the future, I'll keep this in mind. Thanks! – Karen W Feb 14 '12 at 01:19
  • installing named ruby and testing your problem with it will not mess your other rubies, it's completely safe – mpapis Feb 14 '12 at 14:53