Just updated Ruby on a staging server via RVM:
$ rvm upgrade 1.9.3-p327 1.9.3-p362
I said ‘yes’ to all the migration and alias questions including deleting old Ruby.
Now getting error from Passenger whenever I try to access Rails application:
Error message:
dlopen(/Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle, 9):
Library not loaded: /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/libruby.1.9.1.dylib
Referenced from: /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle
Reason: image not found - /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle
I’ve re-installed Passenger…and also ran cap deploy with slightly updated Gemfile. but it appears there are still some references to the old Ruby. What’s happening here and how can up update, or re-compile, so gems etc reference new Ruby? Is there some flag I can specify in Capistrano that would force the recompiling of gems (assuming that’s the problem)?
Edit (adding some RVM info):
I’m using a “Multi-user” installation of RVM on this server and because of that the gems are installed in: /Library/WebServer/rails/popup/shared/bundle/ruby/1.9.1/gems and not where I might have expected them: /usr/local/rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems. Never really understood what RVM was doing in a Multi-user installation but it has worked.
So, poing being I can’t really $ rvm gemset use myapp and then bundle install because I don’t think that would install in the correct directory.
Here’s Capistrano‘s output during bundle install task:
* 2013-01-03 19:23:22 executing `bundle:install'
* executing "cd /Library/WebServer/rails/myapp/releases/20130104032317 && bundle install --gemfile /Library/WebServer/rails/myapp/releases/20130104032317/Gemfile --path /Library/WebServer/rails/myapp/shared/bundle --deployment --quiet --without development test"
The error is about
/Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundlereferencing non existing file/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/libruby.1.9.1.dylibthis should not happen as in most caseslibruby.1.9.1.dylibshould be available as already loaded from ruby when it’s running. So either you have installed ruby using only static compilation or it might be broken.Are you sure ruby
1.9.3-p362is used? RVM provides1.9.3-p327for OSX 10.8 which is compiled statically (no package manager issue on OSX). Maybe you used that version(p327) instead?As for reinstalling the gems – there is not yet a command that would force reinstalling installed gems in bundler, however you can just remove the gems and force installation fresh: