Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails mongrel with RVM fails to startup - mongrel_rails (MissingSourceFile)

I'm having trouble with RVM and mongrel_rails getting along, so any help would be greatly appreciated.

I can happily start my Rails 2.x application with script/server using the Ruby gem mongrel. Details: which rails /opt/local/bin/rails which mongrel_rails /opt/local/bin/mongrel_rails which gem /opt/local/bin/gem

However I've just added RVM with Ruby 1.8.7 and installed all my gems including mongrel but when i try to start my rails app with script/server I now get: no such file to load -- mongrel_rails (MissingSourceFile)

Running a few checks I find:

which mongrel_rails /Users/daniellewis/.rvm/gems/ruby-1.8.7-p334@nacore/bin/mongrel_rails which rails /Users/daniellewis/.rvm/gems/ruby-1.8.7-p334@nacore/bin/rails which gem /Users/daniellewis/.rvm/rubies/ruby-1.8.7-p334/bin/gem

.profile has: export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:$PATH [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

(I'm using macports)

Any ideas on why script/server can't find mongrel_rails? I can only guess it's to do with .profile but I'm not sure what.

Thanks!

like image 422
Dandan Avatar asked Jun 19 '11 07:06

Dandan


1 Answers

The problem is that you have a newer version of "gem" installed inside of RVM than you do in your system ruby. Downgrade your gem and it should work:

gem update --system 1.4.1
like image 185
Bryan Larsen Avatar answered Nov 20 '22 15:11

Bryan Larsen