Ask A Question

Notifications

You’re not receiving notifications from this thread.

"NoMethodError: undefined method `deep_symbolize_keys'" when trying to deploy my application

David McDonald asked in Rails

Hey I followed the deploying guide for Ubuntu 20.04 LTS. When deploying my application I get the following error. Googling around I haven't been able to locate any leads on what to do... anyone have a suggestion to try? Thanks!

My current project I'm attempting to deploy is Rails 5.1.6 as well.

Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@10.117.30.37: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
NoMethodError: undefined method `deep_symbolize_keys' for #<String:0x0000559b3df3afb0>
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/secrets.rb:29:in `block in parse'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/secrets.rb:24:in `each'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/secrets.rb:24:in `each_with_object'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/secrets.rb:24:in `parse'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:391:in `secrets'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:172:in `key_generator'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/globalid-0.4.1/lib/global_id/railtie.rb:26:in `block (2 levels) in <class:Railtie>'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:67:in `block in execute_hook'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:49:in `each'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:73:in `block in <module:Finisher>'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!'
/home/deploy/bane/releases/20200806170130/config/environment.rb:5:in `<top (required)>'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `load'
/home/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace)
Reply

If you read the logs, you'll see it crashed while loading secrets.

/home/deploy/bane/shared/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/secrets.rb:24:in `parse'

So my guess is that you're missing secrets on your server or they're empty or not formatted correctly.

Reply

Thanks Chris!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.