[英]ArgumentError (wrong number of arguments (1 for 0)) after upgrade to Rails 4 and Ruby 2
I upgraded from Ruby 1.8.7 and Rails 3.0.9 to Ruby 2 and Rails 4.0.2. 我从Ruby 1.8.7和Rails 3.0.9升级到Ruby 2和Rails 4.0.2。
An error occurs when I refresh the web page localhost:3000. 刷新网页localhost:3000时发生错误。 I tried to remove all layout code applicaton.html.erb, and application.rb controller code to rule out any change of Ruby or Rails version.
我试图删除所有布局代码applicaton.html.erb和application.rb控制器代码,以排除Ruby或Rails版本的任何更改。 In console, I can't see anything other than the backtrace
在控制台中,除了回溯,我看不到其他任何东西
This crash is in Linux with Oracle, with Mac and Postgress local database goes fine. 在使用Oracle的Linux中,使用Mac和Postgress本地数据库时,此崩溃是正常的。
The error occurs when executing Select to Oracle's sys tables, especially fetching information for SCHEMA_MIGRATIONS table 对Oracle的sys表执行Select时会发生错误,尤其是在获取SCHEMA_MIGRATIONS表的信息时
My Gemfile: 我的Gemfile:
ruby '2.0.0'
source 'https://rubygems.org'
gem 'rails', '4.0.2'
gem 'activerecord-session_store'
gem 'net-ldap'
gem "composite_primary_keys", :require =>'composite_primary_keys'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer' #, '0.11.0beta5'
gem 'libv8', '~> 3.11.8'
gem 'execjs'
gem 'jquery-rails'
gem 'rails-observers'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :oracle do
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter'
end
gem 'debugger', group: [:development, :test]
Server Console: 服务器控制台:
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-12-30 16:53:26] INFO WEBrick 1.3.1
[2013-12-30 16:53:26] INFO ruby 2.0.0 (2013-11-22) [i686-linux]
[2013-12-30 16:53:26] INFO WEBrick::HTTPServer#start: pid=22522 port=3000
Started GET "/" for nnn.nn.nn.nnn at 2013-12-30 16:53:55 +0100
ActiveRecord::SchemaMigration Load (1.4ms) SELECT "SCHEMA_MIGRATIONS".* FROM "SCHEMA_MIGRATIONS"
(2.7ms) SELECT column_name AS name, data_type AS sql_type, data_default, nullable, virtual_column, hidden_column, data_type_owner AS sql_type_owner, DECODE(data_type, 'NUMBER', data_precision, 'FLOAT', data_precision, 'VARCHAR2', DECODE(char_used, 'C', char_length, data_length), 'RAW', DECODE(char_used, 'C', char_length, data_length), 'CHAR', DECODE(char_used, 'C', char_length, data_length), NULL) AS limit, DECODE(data_type, 'NUMBER', data_scale, NULL) AS scale FROM all_tab_cols WHERE owner = '-----' AND table_name = 'SCHEMA_MIGRATIONS' AND hidden_column = 'NO' ORDER BY column_id
Primary Key (34.2ms) SELECT cc.column_name FROM all_constraints c, all_cons_columns cc WHERE c.owner = '-----' AND c.table_name = 'SCHEMA_MIGRATIONS' AND c.constraint_type = 'P' AND cc.owner = c.owner AND cc.constraint_name = c.constraint_name
ArgumentError (wrong number of arguments (1 for 0)):
actionpack (4.0.2) lib/abstract_controller/base.rb:89:in `initialize'
actionpack (4.0.2) lib/abstract_controller/base.rb:89:in `new'
actionpack (4.0.2) lib/abstract_controller/base.rb:89:in `action_methods'
actionpack (4.0.2) lib/action_controller/metal/hide_actions.rb:36:in `action_methods'
actionpack (4.0.2) lib/abstract_controller/url_for.rb:25:in `action_methods'
actionpack (4.0.2) lib/abstract_controller/base.rb:179:in `action_method?'
actionpack (4.0.2) lib/abstract_controller/base.rb:230:in `method_for_action'
actionpack (4.0.2) lib/action_controller/metal/hide_actions.rb:17:in `method_for_action'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:14:in `method_for_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:130:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'.......
Solved. 解决了。
I don't know what was happening exactly, but the solution was get back to the older version of RoR, thanks git branch
and rvm, and execute again Bundle update and Bundle install. 我不知道到底发生了什么,但是解决方案是回到旧版本的RoR,感谢
git branch
和rvm,然后再次执行Bundle更新和Bundle安装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.