首页 > 解决方案 > 导轨中止!ArgumentError:参数数量错误(给定 0,预期 1..2)

问题描述

我正在尝试进行生产迁移并得到上述错误。在开发模式下,它们工作正常,但是当我尝试迁移到生产环境时出现此错误。

/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/cache/file_store.rb:24:in `initialize'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/cache.rb:60:in `new'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/cache.rb:60:in `lookup_store'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/application/bootstrap.rb:67:in `block in <module:Bootstrap>'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/initializable.rb:32:in `instance_exec'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/initializable.rb:32:in `run'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/initializable.rb:60:in `run_initializers'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/application.rb:361:in `initialize!'
/home/Steven.Cahill/Brighter/Adviser/config/environment.rb:7:in `<main>'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/application.rb:337:in `require_environment!'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/command.rb:48:in `invoke'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/railties-5.2.4.1/lib/rails/commands.rb:18:in `<main>'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/Steven.Cahill/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require'

标签: ruby-on-railsmigrationproduction

解决方案


查看 Brighter/Adviser/config/environment.rb:7:in `'

此错误表明 rvm 在需要一些依赖项方面存在问题。

检查您的 rvm 设置


推荐阅读