耙子流产了!错误的参数个数(1表示0)

时间:2015-02-03 13:33:08

标签: ruby-on-rails rake

运行rake路由会给出错误的参数数量(1表示0)"错误。在没有任何任务的情况下运行rake会抛出相同的结果。这是两个(rake --trace)的输出:

注意:即使使用空的routes.rb也会发生这种情况 rake版本是(10.4.2)

**调用默认值(first_time) **调用测试(first_time) **执行测试 **调用测试:run(first_time) **执行测试:运行 耙子流产了! 错误的参数个数(1表示0) /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:90:in initialize' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:90:in new&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:90:in action_methods' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:548:in respond_to?&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionpack-4.2.0/lib/action_dispatch/routing/url_for.rb:99:in block in <module:UrlFor>' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:120:in class_eval&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:120:in append_features' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:117:in包括&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:117:in block in append_features' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:117:in每个&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/concern.rb:117:in append_features' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/railtie.rb:33:in包括&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/railtie.rb:33:in block (2 levels) in <class:Railtie>' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in instance_eval&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in execute_hook' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:45:in阻止在run_load_hooks&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:44:in each' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:945:in <class:Base>' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:417:in&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:9:in <top (required)>' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/actionmailer-4.2.0/lib/action_mailer/railtie.rb:59:in阻止&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:36:in call' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:36:in execute_hook&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:44:in每个&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/application/finisher.rb:62:in阻止&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/initializable.rb:30:in instance_exec' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/initializable.rb:30:in run&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/initializable.rb:55:in block in run_initializers' /usr/lib64/ruby/1.9.3/tsort.rb:150:in阻止tsort_each&#39; /usr/lib64/ruby/1.9.3/tsort.rb:183:in block (2 levels) in each_strongly_connected_component' /usr/lib64/ruby/1.9.3/tsort.rb:219:in each_strongly_connected_component_from&#39; /usr/lib64/ruby/1.9.3/tsort.rb:182:in block in each_strongly_connected_component' /usr/lib64/ruby/1.9.3/tsort.rb:180:in每个&#39; /usr/lib64/ruby/1.9.3/tsort.rb:180:in each_strongly_connected_component' /usr/lib64/ruby/1.9.3/tsort.rb:148:in tsort_each&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/initializable.rb:54:in run_initializers' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/application.rb:352:in初始化!&#39; /home4/libreame/rails_apps/websquid/config/environment.rb:7:in <top (required)>' /home4/libreame/rails_apps/websquid/test/test_helper.rb:2:in要求&#39; /home4/libreame/rails_apps/websquid/test/test_helper.rb:2:in <top (required)>' /home4/libreame/rails_apps/websquid/test/controllers/links_controller_test.rb:1:in要求&#39; /home4/libreame/rails_apps/websquid/test/controllers/links_controller_test.rb:1:in <top (required)>' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:114:in要求&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:114:in block (3 levels) in define' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:114:in每个&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:114:in block (2 levels) in define' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:113:in每个&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:113:in block in define' /usr/lib64/ruby/1.9.3/rake/task.rb:205:in来电&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:205:in block in execute' /usr/lib64/ruby/1.9.3/rake/task.rb:200:in每个&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:200:in execute' /usr/lib64/ruby/1.9.3/rake/task.rb:158:in阻止invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/monitor.rb:211:in mon_synchronize' /usr/lib64/ruby/1.9.3/rake/task.rb:151:in invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:144:in invoke' /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/sub_test_task.rb:20:in invoke_rake_task&#39; /home4/libreame/rails_apps/websquid/vendor/cache/ruby/1.9.3/gems/railties-4.2.0/lib/rails/test_unit/testing.rake:8:in block in <top (required)>' /usr/lib64/ruby/1.9.3/rake/task.rb:205:in来电&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:205:in block in execute' /usr/lib64/ruby/1.9.3/rake/task.rb:200:in每个&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:200:in execute' /usr/lib64/ruby/1.9.3/rake/task.rb:158:in阻止invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/monitor.rb:211:in mon_synchronize' /usr/lib64/ruby/1.9.3/rake/task.rb:151:in invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:176:in block in invoke_prerequisites' /usr/lib64/ruby/1.9.3/rake/task.rb:174:in每个&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:174:in invoke_prerequisites' /usr/lib64/ruby/1.9.3/rake/task.rb:157:in阻止invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/monitor.rb:211:in mon_synchronize' /usr/lib64/ruby/1.9.3/rake/task.rb:151:in invoke_with_call_chain&#39; /usr/lib64/ruby/1.9.3/rake/task.rb:144:in invoke' /usr/lib64/ruby/1.9.3/rake/application.rb:116:in invoke_task&#39; /usr/lib64/ruby/1.9.3/rake/application.rb:94:in block (2 levels) in top_level' /usr/lib64/ruby/1.9.3/rake/application.rb:94:in每个&#39; /usr/lib64/ruby/1.9.3/rake/application.rb:94:in block in top_level' /usr/lib64/ruby/1.9.3/rake/application.rb:133:in standard_exception_handling&#39; /usr/lib64/ruby/1.9.3/rake/application.rb:88:in top_level' /usr/lib64/ruby/1.9.3/rake/application.rb:66:in阻止运行&#39; /usr/lib64/ruby/1.9.3/rake/application.rb:133:in standard_exception_handling' /usr/lib64/ruby/1.9.3/rake/application.rb:63:in运行&#39; / usr / bin / rake:32:在'&#39; 任务:TOP =&gt;试验:运行

到目前为止

Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'

# Use sqlite3 as the database for Active Record
#gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
#gem 'execjs'
#gem 'therubyracer', platforms: :ruby
gem 'libv8', '3.11.8.3'
gem 'therubyracer', '0.11.0beta5'

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

gem 'mysql2', '0.3.13'

gem 'thin'

gem 'open_uri_redirections'

gem 'certified'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

1 个答案:

答案 0 :(得分:0)

更改gemfile解决了这个问题。之前:

#gem 'therubyracer', platforms: :ruby
gem 'libv8', '3.11.8.3'
gem 'therubyracer', '0.11.0beta5'

相反,我写道:

gem 'therubyracer', platforms: :ruby
#gem 'libv8', '3.11.8.3'
#gem 'therubyracer', '0.11.0beta5'

它与Javascript运行时有关,但是rake错误太过神秘了。