简体   繁体   English

RVM导轨版本未加载

[英]RVM rails version not loading

I have just downloaded rvm to manage my ruby versioning. 我刚刚下载了rvm来管理我的ruby版本。 I have created a new gemset and installed rails 2.3.8. 我创建了一个新的gemset并安装了Rails 2.3.8。 gem list shows the following gems 宝石清单显示以下宝石

*** LOCAL GEMS ***

actionmailer (2.3.8)  
actionpack (2.3.8)  
activerecord (2.3.8) 
activeresource (2.3.8)  
activesupport (2.3.8)  
rack (1.1.0)  
rails (2.3.8) 
rake (0.8.7)

But when i run sudo script/server I get the following error: 但是当我运行sudo脚本/服务器时,出现以下错误:

Missing the Rails 2.3.8 gem. 缺少Rails 2.3.8宝石。 Please gem install -v=2.3.8 rails , update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. gem install -v=2.3.8 rails ,在config / environment.rb中为您已安装的Rails版本更新RAILS_GEM_VERSION设置,或注释掉RAILS_GEM_VERSION以使用最新安装的版本。

Am I missing something? 我想念什么吗? why am I unable to start the ror webrick server? 为什么我无法启动ror webrick服务器?

You don't need to run this as root, in fact that is most likely why this is breaking. 您无需以root用户身份运行此文件,实际上,这很可能是导致此中断的原因。 RVM is running as your user, so when you do "sudo" script/server its looking at the gems installed in the context of root, not as your user. RVM以您的用户身份运行,因此当您执行“ sudo”脚本/服务器时,它会查看以root身份而不是您的用户身份安装的gem。

Just do script/server and you should be fine. 只要执行脚本/服务器,就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM