Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 获取未定义的方法`name';至于;actionmailer";:安装Webistrano时的字符串_Ruby On Rails_Webistrano - Fatal编程技术网

Ruby on rails 获取未定义的方法`name';至于;actionmailer";:安装Webistrano时的字符串

Ruby on rails 获取未定义的方法`name';至于;actionmailer";:安装Webistrano时的字符串,ruby-on-rails,webistrano,Ruby On Rails,Webistrano,当我尝试在Webistrano上运行RAKE时,会出现以下错误: undefined method `name' for "actionmailer":String` 我对Ruby和RoR并不精通,但我以前安装过很多应用程序,玩过很多游戏,我找不到问题所在 我正在运行的命令是: RAILS_ENV=production rake db:migrate --trace 产生以下结果: 我真的很想知道诊断和解决这个问题以及将来类似问题的最佳方法 (in /srv/www/webistrano)

当我尝试在Webistrano上运行RAKE时,会出现以下错误:

undefined method `name' for "actionmailer":String`
我对Ruby和RoR并不精通,但我以前安装过很多应用程序,玩过很多游戏,我找不到问题所在

我正在运行的命令是:

RAILS_ENV=production rake db:migrate --trace
产生以下结果:

我真的很想知道诊断和解决这个问题以及将来类似问题的最佳方法

(in /srv/www/webistrano)
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `name' for "actionmailer":String
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:268:in `=='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `==='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `block in matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:411:in `block in each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `find_all'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in `to_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:73:in `add_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `block in add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `each'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:132:in `process'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:113:in `run'
/srv/www/webistrano/config/environment.rb:16:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `block in require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/srv/www/webistrano/vendor/rails/railties/lib/tasks/misc.rake:4:in `block in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in     `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => environment
我有这个问题。 解决方案是将rubygems降级到您支持的版本

我需要版本1.3.5(用于rails 2.3.5)

所以你需要做:

gem安装rubygems更新-v1.3.5

更新\u rubygems--version=1.3.5

现在耙子应该可以工作了。

这对我来说很有效

rvm rubygems 1.6.2
rvm rubygems 1.6.2