安装rake gem时出现问题。

13 浏览
0 Comments

安装rake gem时出现问题。

我正在使用Rails 2.3.5和Ruby 1.8.7版本。在运行以下命令后,我遇到了以下错误。有什么想法吗?\n$ rake gem:install\n$ rake/rdoctask已弃用,请使用rdoc/task代替(在RDoc 2.4.2+中)\n$ rake中止!\n$ rake gem:install --trace\nrake/rdoctask已弃用,请使用rdoc/task代替(在RDoc 2.4.2+中)\nrake中止!\n未初始化常量ActiveSupport::Dependencies::Mutex\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in `const_missing\'\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require\'\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require\'\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support.rb:56\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require\'\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require\'\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:18\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `load\'\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/rails.rb:4\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `each\'\n/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/rails.rb:4\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require\'\n/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require\'\n/Users/P/Dev/loginform/unobtrusive-login/Rakefile:10\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:61:in `run\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run\'\n/Library/Ruby/Gems/1.8/gems/rake-0.9.2/bin/rake:32\n/usr/bin/rake:19:in `load\'\n/usr/bin/rake:19

0
0 Comments

问题出现的原因是使用了版本不兼容的rubygems和rake。解决方法是使用rubygems版本1.4及以下和rake版本0.8.7。

解决方法:

gem install rubygems-update -v 1.4.0
gem update --system 1.4.0
gem install rake -v 0.8.7

0
0 Comments

问题出现的原因是RubyGems版本不兼容Rails 2.3.8,解决方法是将RubyGems版本更新为1.5.3。

文章内容如下:

我正在使用Ruby 1.8.7和Rails 2.3.8,出现了同样的错误。所以我将我的RubyGems版本更改为1.5.3,问题得到解决。你需要做的是运行以下命令:

gem update --system 1.5.3

这将把你的ruby gems版本更新为完全适用于rails 2.3.8的1.5.3版本。

希望对你有所帮助。

0
0 Comments

问题原因:在Rakefile的第一行,require 'rake/rdoctask'应该改为require 'rdoc/task'

解决方法:需要升级Rails版本或降级gem版本。可以使用以下命令更改gem版本:gem update --system x.y.z。更多关于问题的信息可以在此链接中找到:Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)

我得到的错误信息:no such file to load -- rdoc/task。

0