简体   繁体   English

Rails找不到我的宝石

[英]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.

相关问题 为什么我的Rails应用程序找不到与它一起打包的宝石? - Why can't my Rails app find the gems that are packaged with it? Rails db:migrate找不到宝石 - Rails db:migrate can't find gems Rails 3:Passenger无法找到bundler安装的git gem - Rails 3: Passenger can't find git gems installed by bundler Rails 4我无法安装gem - Rails 4 I can't install gems Rails为什么找不到宝石? - Why can't Rails locate gems? 更新了我的路径,现在我的程序找不到我的宝石 - Updated my path and now my program can't find my gems 我设置了我的AWS密钥,它们显示在linux终端中,但是Rails 4应用程序找不到它们。 使用aws-sdk和carrierwave-aws宝石 - I set my AWS keys and they show up in linux terminal, but Rails 4 app can't find them. Using aws-sdk and carrierwave-aws gems 与Capistrano一起部署后,Rails(美洲狮和乘客)找不到捆绑的宝石 - Rails (Puma & Passenger) can't find bundled gems after deploying with Capistrano 乘客在生产中找不到宝石 - Passenger can't find gems in production Rails、gems、require、zsh 和错误消息! 由于与“require”相关的问题,我无法加载我的应用程序 - Rails, gems, require, zsh and an error message! I can't load my app because of an issue related to “require”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM