[英]Rails can't find my gems
I'm working on a newly configured computer, and can't seem to get rails to play nicely with my gems. 我正在新配置的计算机上工作,似乎无法让滑轨与我的宝石完美配合。 Below are some of the errors I'm running into.
以下是我遇到的一些错误。
If I run 'script/console' in a rails project, I get the following error: 如果我在Rails项目中运行“脚本/控制台”,则会出现以下错误:
Missing the Rails gem.
缺少Rails宝石。 Please
gem install -v= 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= rails
,更新config / environment.rb中的RAILS_GEM_VERSION设置以获取已安装的Rails版本,或注释掉RAILS_GEM_VERSION以使用最新安装的版本。
If I run 'rails -v' I get the following error: 如果我运行“ rails -v”,则会出现以下错误:
/Library/Ruby/Site/1.8/rubygems.rb:777:in `report_activate_error': RubyGem version error: activesupport(1.4.4 not = 2.3.4) (Gem::LoadError)
/库/Ruby/Site/1.8/rubygems.rb:777:`report_activate_error':RubyGem版本错误:activesupport(1.4.4 not = 2.3.4)(Gem :: LoadError)
Both activesupport and rails gems are installed and updated, and are listed when I run 'gem list.' activesupport和rails gem均已安装和更新,并且在运行“ gem list”时列出。 Any ideas?
有任何想法吗? Thanks!
谢谢!
Is the location of the gems defined? 是否定义了宝石的位置? (either in ~/.bash_profile or ~/.bashrc)
(在〜/ .bash_profile或〜/ .bashrc中)
Something like: 就像是:
export GEM_PATH=/Library/Ruby/Gems/1.8/:${GEM_PATH}
You'll want to see if you have gems on your home directory or off the root. 您将要查看您的主目录上或根目录下是否有gem。 You can do this by running
gem environment
. 您可以通过运行
gem environment
来做到这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.