安装rake gem时出现问题。
安装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
问题原因:在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。