带RVM的Rails mongrel无法启动 - mongrel_rails(MissingSourceFile)

时间:2022-12-30 20:38:59

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

我在使用RVM和mongrel_rails方面遇到了麻烦,所以任何帮助都会非常感激。

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

我可以愉快地使用Ruby gem mongrel使用脚本/服务器启动我的Rails 2.x应用程序。详情:哪个rails / opt / local / bin / rails哪个mongrel_rails / opt / local / bin / mongrel_rails哪个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)

但是我刚刚用Ruby 1.8.7添加了RVM并安装了我的所有宝石,包括mongrel但是当我尝试使用脚本/服务器启动我的rails应用程序时,我现在得到:没有这样的文件要加载 - 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

其中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哪个宝石/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"

.profile有:export PATH = / opt / local / bin:/ opt / local / sbin:/ usr / local / mysql / bin:$ PATH [[-s“$ HOME / .rvm / scripts / rvm”]] && 。 “$ HOME / .rvm /脚本/ RVM”

(I'm using macports)

(我正在使用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.

有关为什么脚本/服务器无法找到mongrel_rails的任何想法?我只能猜测它与.profile有关,但我不确定是什么。

Thanks!

1 个解决方案

#1


12  

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:

问题是你在RVM中安装了一个比你的系统ruby更新版本的“gem”。降级你的宝石,它应该工作:

gem update --system 1.4.1

#1


12  

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:

问题是你在RVM中安装了一个比你的系统ruby更新版本的“gem”。降级你的宝石,它应该工作:

gem update --system 1.4.1