没有将Hash隐式转换为String(TypeError)

时间:2016-03-23 10:03:33

标签: activesupport ruby-on-rails-5

使用RoR 5.0.0.beta3分支。从昨天开始服务器不再启动了。

我正在使用的宝石:

gem 'devise', "4.0.0.rc2"
gem 'rails', github: "rails/rails", branch: "v5.0.0.beta3"
gem 'mongoid', github: 'mediatainment/mongoid', branch: 'MONGOID-4218-rails-5'
gem 'simple_token_authentication', github: "mediatainment/simple_token_authentication", branch: :remove_deprication_for_rails51

这是stacktrace:

Exiting
/Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:428:in `join': no implicit conversion of Hash into String (TypeError)
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:428:in `block in search_for_file'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:427:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:427:in `search_for_file'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:502:in `load_missing_constant'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:203:in `const_missing'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:259:in `const_get'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:259:in `block in constantize'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `inject'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:257:in `constantize'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/inflector/methods.rb:302:in `safe_constantize'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/core_ext/string/inflections.rb:77:in `safe_constantize'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/engine.rb:34:in `block (2 levels) in <class:Railtie>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:81:in `<module:Server>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:4:in `<module:ActionCable>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/server/base.rb:3:in `<top (required)>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable.rb:43:in `server'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actioncable/lib/action_cable/engine.rb:49:in `block (3 levels) in <class:Railtie>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `block in clear!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/actionpack/lib/action_dispatch/routing/route_set.rb:405:in `clear!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:35:in `block in clear!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:33:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:33:in `clear!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:15:in `reload!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/file_update_checker.rb:75:in `call'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/file_update_checker.rb:75:in `execute'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application/finisher.rb:103:in `block in <module:Finisher>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:30:in `run'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/application.rb:353:in `initialize!'
    from /Users/jan/RubymineProjects/global-gigs-api/config/environment.rb:5:in `<top (required)>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `require'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `block in require'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:259:in `load_dependency'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/activesupport/lib/active_support/dependencies.rb:293:in `require'
    from /Users/jan/RubymineProjects/global-gigs-api/config.ru:3:in `block in <main>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `initialize'
    from /Users/jan/RubymineProjects/global-gigs-api/config.ru:in `new'
    from /Users/jan/RubymineProjects/global-gigs-api/config.ru:in `<main>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `eval'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:40:in `parse_file'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:318:in `build_app_and_options_from_config'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:218:in `app'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:59:in `app'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:353:in `wrapped_app'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:123:in `log_to_stdout'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/server.rb:77:in `start'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:90:in `block in server'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:85:in `tap'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:85:in `server'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/bundler/gems/rails-2346c7f28163/railties/lib/rails/commands.rb:18:in `<top (required)>'
    from /Users/jan/RubymineProjects/global-gigs-api/bin/rails:9:in `require'
    from /Users/jan/RubymineProjects/global-gigs-api/bin/rails:9:in `<top (required)>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/jan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/jan/RubymineProjects/global-gigs-api/bin/spring:13:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'
MacBook-Pro:global-gigs-api jan$

1 个答案:

答案 0 :(得分:2)

奇怪:似乎action_mailer.default导致了这个问题。已将其更改为default_options

config.action_mailer.default_options = {
    :charset => "utf-8",
    from: ENV['MAIL_SENDER_EMAIL']}