简体   繁体   English

缺少Rails 2.3.4宝石。 即使它已安装!

[英]Missing the Rails 2.3.4 gem. Even though it's installed!

Running Snow Leopard. 跑雪豹。 Tried uninstalling, and re-installing. 尝试卸载,然后重新安装。 Still getting the same error whenever I run a rake task. 每当我运行rake任务时仍会出现相同的错误。

mbpro:redmine shereef$ ruby -v mbpro:redmine shereef $ ruby​​ -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] ruby 1.8.7(2009-06-12 patchlevel 174)[i686-darwin10.0.0]

mbpro:redmine shereef$ rails -v mbpro:redmine shereef $ rails -v
Rails 2.3.4 Rails 2.3.4

mbpro:redmine shereef$ which rails mbpro:redmine shereef $ rails
/usr/local/bin/rails 在/ usr / local / bin目录/轨

mbpro:redmine shereef$ gem -v mbpro:redmine shereef $ gem -v
1.3.5 1.3.5

mbpro:redmine shereef$ which gem mbpro:redmine shereef $是哪个宝石
/usr/local/bin/gem 在/ usr / local / bin目录/宝石

mbpro:redmine shereef$ rake -v mbpro:redmine shereef $ rake -v
(in /Users/shereef/Documents/Code/BetterMeans/redmine) (在/ Users / shereef / Documents / Code / BetterMeans / redmine中)
Missing the Rails 2.3.4 gem. 缺少Rails 2.3.4宝石。 Please gem install -v=2.3.4 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.4 rails ,在config / environment.rb中更新您已安装的Rails版本的RAILS_GEM_VERSION设置,或注释掉RAILS_GEM_VERSION以使用安装的最新版本。

mbpro:redmine shereef$ which rake mbpro:redmine shereef $ rake
/usr/bin/rake 在/ usr / bin中/耙

mbpro:redmine shereef$ $PATH mbpro:redmine shereef $ $ PATH
-bash: /usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin: No such file or directory -bash:/ usr / local / bin:/ usr / local / sbin:/ usr / local / mysql / bin:/ opt / local / bin:/ opt / local / sbin:/ opt / local / bin:/ opt / local / sbin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / bin:/ usr / local / git / bin:/ usr / X11 / bin:没有这样的文件或目录

mbpro:redmine shereef$ mbpro:redmine shereef $

On Fedora 12 you need to 在Fedora 12上你需要

$ gem install -v=1.0.1 rack

for the bundled rails to work. 为捆绑的铁路工作。

您是否尝试过在您的应用程序中运行rake:rails:update

I too had faced a similar issue. 我也遇到过类似的问题。 Please verify whether rails 2.3.4 is installed properly using the "gem list" command. 请使用“gem list”命令验证rails 2.3.4是否已正确安装。 If more than one copy of rails are present in gem list, remove the unwanted version using "gem uninstall rails" and select the required version. 如果gem列表中存在多个rails副本,请使用“gem uninstall rails”删除不需要的版本,然后选择所需的版本。

Whenever I installed a newer version of rack this would happen. 每当我安装更新版本的机架时,都会发生这种情况。 Making sure I had v 1.0.1 made it always work. 确保我有v 1.0.1使它始终有效。

The solution that worked for me was to remove ruby 1.8.7, reinstall it and use gemsets. 对我有用的解决方案是删除ruby 1.8.7,重新安装它并使用gemsets。 This is the code if you're using rvm and ruby is correctly on it. 如果您正在使用rvm并且正确使用ruby,那么这就是代码。

rvm remove 1.8.7 
rvm package install readline # I'm not sure this is needed...
rvm install 1.8.7 --with-readline-dir=$rvm_path/usr # same here for option
rvm gemset create mine
rvm 1.8.7@mine
rvm use 1.8.7@mine --default # IF you do not want to change rv each terminal
gem install rails -v=2.3.5

I'm not sure but I think that rails was not seen because of the global gemset, but rails is pretty new to me to go deep in the explanation. 我不确定,但我认为因为全球宝石而没有看到导轨,但对于我来说,使用导轨对于深入解释是很新的。

Edit: In the case that there is no need to reinstall ruby, this should be enough, in both cases you'll have to reinstall all your gems. 编辑:如果没有必要重新安装ruby,这应该就足够了,在这两种情况下你都必须重新安装所有的宝石。

rvm gemset create mine
rvm 1.8.7@mine
rvm use 1.8.7@mine --default # IF you do not want to change rv each terminal
gem install rails -v=2.3.5

let me know... 让我知道...

Since you have your own copy of ruby in /usr/local, I suspect that somehow rake is still trying to use the builtin os x ruby/gem command. 由于你在/ usr / local中有自己的ruby副本,我怀疑rake仍然试图使用builtin os x ruby​​ / gem命令。

Try running 'gem env' to make sure your environment is set up correctly. 尝试运行'gem env'以确保您的环境设置正确。 In particular, look at the GEM PATHS: to make sure they are pointed at your /usr/local directory. 特别是,请查看GEM PATHS:确保它们指向您的/ usr / local目录。 If they are wrong try setting GEM_HOME and/or GEM_PATH in your environment. 如果错误,请尝试在您的环境中设置GEM_HOME和/或GEM_PATH

Here is what my output looks like (though I use a ruby install dir in my own how directory via the ruby_switcher.sh tool ( http://github.com/relevance/etc ) 这是我的输出看起来像(虽然我通过ruby_switcher.sh工具在我自己的how目录中使用ruby安装目录( http://github.com/relevance/etc

RubyGems Environment:
      - RUBYGEMS VERSION: 1.3.5
      - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
      - INSTALLATION DIRECTORY: /Users/ashebanow/.gem/ruby/1.8
      - RUBY EXECUTABLE: /Users/ashebanow/.ruby_versions/ruby-1.8.7-p174/bin/ruby
      - EXECUTABLE DIRECTORY: /Users/ashebanow/.gem/ruby/1.8/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86-darwin-10
      - GEM PATHS:
         - /Users/ashebanow/.gem/ruby/1.8
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => false
         - :bulk_threshold => 1000
         - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com/"]
      - REMOTE SOURCES:
         - http://gems.rubyforge.org/
         - http://gems.github.com/

I had similar problems, and another gem to keep an eye on is activesupport. 我有类似的问题,另一个值得关注的宝石是activesupport。 I found if I had other versions that differed from my Rails version, it could cause this as well. 我发现如果我有其他版本与我的Rails版本不同,它也可能导致这种情况。

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

相关问题 脚本/控制台不起作用; 报告“缺少Rails宝石。 即使rails显示为已安装,也请`gem install -v = rails ......” - script/console won't work; reports “Missing the Rails gem. Please `gem install -v= rails`…” even though rails shows as installed 缺少Rails宝石。 请`gem install -v = 2.3.4 rails` - Missing the Rails gem. Please `gem install -v=2.3.4 rails` 如果在供应商/宝石中安装了gem,为什么Rails(2.3.4)会抱怨缺少该宝石? - If gem is installed in vendor/gems, why would Rails (2.3.4) complain that it is missing? 即使安装了正确的gem,rails中的NoMethodError也是如此 - NoMethodError in rails even though correct gem is installed Ruby on Rails:即使已安装gem仍未找到 - Ruby on Rails: gem not found even though it is installed 大礼包0.11.2,横杆2.3.12,即使安装了大礼包0.11.2宝石也没有 - spree 0.11.2, rails 2.3.12, missing the spree 0.11.2 gem even though it is installed 缺少Rails 2.3.11宝石。 请`gem install -v = 2.3.11 rails`, - Missing the Rails 2.3.11 gem. Please `gem install -v=2.3.11 rails`, 轨道2.3.4中的宝石兼容性 - Gem compatibility in rails 2.3.4 指示即使未安装也未安装的Ruby gem - Ruby gem indicative of not being installed even though it is Wails -s3 gem和right_aws gem之间的Rails Paperclip冲突。 怎么解决? - Rails Paperclip conflict between aws-s3 gem and right_aws gem. How to solve?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM