Heroku Deployment Fails at start-up
2019-11-07T18:49:50.363700+00:00 app[web.1]: from bin/rails:9:in `<main>'2019-11-07T18:49:50.424935+00:00 heroku[web.1]: Process exited with status 12019-11-07T18:49:56.376588+00:00 app[web.1]: => Booting Puma2019-11-07T18:49:56.376620+00:00 app[web.1]: => Rails 6.0.0 application starting in production 2019-11-07T18:49:56.376623+00:00 app[web.1]: => Run `rails server --help` for more startup options2019-11-07T18:49:57.545612+00:00 app[web.1]: Exiting2019-11-07T18:49:57.546322+00:00 app[web.1]: /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/base64.rb:59:in `decode64': undefined method `unpack1' for nil:NilClass (NoMethodError)2019-11-07T18:49:57.546328+00:00 app[web.1]: from /app/app/models/user/connected_account.rb:37:in `<class:ConnectedAccount>'2019-11-07T18:49:57.546332+00:00 app[web.1]: from /app/app/models/user/connected_account.rb:31:in `<main>'2019-11-07T18:49:57.546334+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'2019-11-07T18:49:57.546353+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'2019-11-07T18:49:57.546355+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'2019-11-07T18:49:57.546357+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'2019-11-07T18:49:57.546359+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
It continues on like this for awhile, but it's a lot of similar errors around ruby.rb, kernel_ruby.rb (Or something similar). It builds successfully locally, but as soon as I push it to Heroku this happens.
heroku run rake db:migrate works (It seems) and the DBs are generated. Redis is installed, and I added in the webpack it said too. Anything else I might be missing?
Hey
Chris Oliver
,
Thanks for replying; Is it safe to assume this should be the `test.key` under `config/credentials`? If so, I have that currently.
If it matters, for the first few lines it is:
Thanks for replying; Is it safe to assume this should be the `test.key` under `config/credentials`? If so, I have that currently.
If it matters, for the first few lines it is:
2019-11-08T04:04:29.933218+00:00 app[web.1]: => Booting Puma2019-11-08T04:04:29.933239+00:00 app[web.1]: => Rails 6.0.0 application starting in production 2019-11-08T04:04:29.933241+00:00 app[web.1]: => Run `rails server --help` for more startup options2019-11-08T04:04:31.758795+00:00 app[web.1]: Exiting2019-11-08T04:04:31.759104+00:00 app[web.1]: /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/base64.rb:59:in `decode64': undefined method `unpack1' for nil:NilClass (NoMethodError)2019-11-08T04:04:31.759110+00:00 app[web.1]: from /app/app/models/user/connected_account.rb:37:in `<class:ConnectedAccount>'2019-11-08T04:04:31.759116+00:00 app[web.1]: from /app/app/models/user/connected_account.rb:31:in `<main>'2019-11-08T04:04:31.759118+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'2019-11-08T04:04:31.759123+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
Sort of. You will have to create credentials for each environment you want to run. If you're using RAILS_ENV=production on Heroku (which you normally will), then you need to run "rails credentials:edit --environment=production" and add your keys. That will create config/credentials/production.key and that's what you'd want to put in Heroku as RAILS_MASTER_KEY.
More details on all that:
https://jumpstartrails.com/jumpstart/docs/credentials
And:
https://blog.bigbinary.com/2019/07/03/rails-6-adds-support-for-multi-environment-credentials.html
More details on all that:
https://jumpstartrails.com/jumpstart/docs/credentials
And:
https://blog.bigbinary.com/2019/07/03/rails-6-adds-support-for-multi-environment-credentials.html
Thanks for the links, so this is the reference I expected - So I modified Heroku to Test environment, and included the `test.key` within it, however the failures are still similar.
They kick off slightly different (Blaming letter_opener now) but still references some `kernel.rb` file.
They kick off slightly different (Blaming letter_opener now) but still references some `kernel.rb` file.
2019-11-08T12:49:49.741465+00:00 app[web.1]: => Booting Puma2019-11-08T12:49:49.741497+00:00 app[web.1]: => Rails 6.0.0 application starting in test 2019-11-08T12:49:49.741504+00:00 app[web.1]: => Run `rails server --help` for more startup options2019-11-08T12:49:50.513460+00:00 app[web.1]: Exiting2019-11-08T12:49:50.516869+00:00 app[web.1]: /app/config/routes.rb:7:in `block in <main>': uninitialized constant LetterOpenerWeb (NameError)2019-11-08T12:49:50.516899+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:429:in `instance_exec'2019-11-08T12:49:50.516929+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:429:in `eval_block'2019-11-08T12:49:50.516955+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:411:in `draw'2019-11-08T12:49:50.516982+00:00 app[web.1]: from /app/config/routes.rb:2:in `<main>'2019-11-08T12:49:50.517008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'2019-11-08T12:49:50.517034+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
Just updated the docs to include a video and detailed Heroku instructions: https://jumpstartrails.com/jumpstart/docs/deploying
I got the same basic errors (deploying a fresh instance of the OOTB Jumpstart Pro template, freshly pushed from known-good on local system). As shown below, I did configure the (production) credentials key (and set RAILS_MASTER_KEY) in Heroku:
... so I looked at the Build Log in Heroku:
I wasn't sure if that "Detecting rails configuration failed" message was noise or real, but it smelled very relevant. I set the HEROKU_DEBUG_RAILS_RUNNER flag as described, then poked around some more (several StackOverflow searches) ... and then:
... so I looked at the Build Log in Heroku:
I wasn't sure if that "Detecting rails configuration failed" message was noise or real, but it smelled very relevant. I set the HEROKU_DEBUG_RAILS_RUNNER flag as described, then poked around some more (several StackOverflow searches) ... and then:
- I realized I had not committed the config/credentials/production.yml.enc file to git after editing, so it did not get to Heroku when I did my get push (to Heroku).
I hope this helps others.
Notifications
You’re not receiving notifications from this thread.