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!