I'm trying to launch my Rails 6.0.2.1, Ruby 2.6.5 application in production using AWS EB CLI, however, I continue to encounter this issue. I've tried every solution that exists within the first two pages of Google's search results for this to no avail.
These are my error logs:
ruby-2.0.0-p648
ruby-2.1.10
ruby-2.2.10
ruby-2.3.8
ruby-2.4.9
ruby-2.5.7
ruby-2.6.5
ruby-current ]]
+++ RUBIES+=("$dir"/*)
+++ for dir in '"$PREFIX/opt/rubies"' '"$HOME/.rubies"'
+++ [[ -d /.rubies ]]
+++ unset dir
+++ cat /etc/elasticbeanstalk/.ruby_version
++ chruby 2.6.5
++ case "$1" in
++ local dir match
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-1.9.3-p551
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.0.0-p648
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.1.10
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.2.10
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.3.8
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.4.9
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.5.7
++ case "${dir##*/}" in
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-2.6.5
++ case "${dir##*/}" in
++ match=/opt/rubies/ruby-2.6.5
++ for dir in '"${RUBIES[@]}"'
++ dir=/opt/rubies/ruby-current
++ case "${dir##*/}" in
++ [[ -z /opt/rubies/ruby-2.6.5 ]]
++ shift
++ chruby_use /opt/rubies/ruby-2.6.5 ''
++ [[ ! -x /opt/rubies/ruby-2.6.5/bin/ruby ]]
++ [[ -n '' ]]
++ export RUBY_ROOT=/opt/rubies/ruby-2.6.5
++ RUBY_ROOT=/opt/rubies/ruby-2.6.5
++ export RUBYOPT=
++ RUBYOPT=
++ export PATH=/opt/rubies/ruby-2.6.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
++ PATH=/opt/rubies/ruby-2.6.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
+++ /opt/rubies/ruby-2.6.5/bin/ruby -
++ eval 'export RUBY_ENGINE=ruby;
export RUBY_VERSION=2.6.5;
export GEM_ROOT="/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0";'
+++ export RUBY_ENGINE=ruby
+++ RUBY_ENGINE=ruby
+++ export RUBY_VERSION=2.6.5
+++ RUBY_VERSION=2.6.5
+++ export GEM_ROOT=/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
+++ GEM_ROOT=/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
++ (( 0 != 0 ))
+ cd /var/app/ondeck
+ su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler20200229-17441-1xumk3r17441' as your home directory temporarily.
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler20200229-17445-s2fu1t17445' as your home directory temporarily.
rake aborted!
ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit`
/var/app/ondeck/config/environment.rb:5:in `<main>'
/opt/rubies/ruby-2.6.5/bin/bundle:23:in `load'
/opt/rubies/ruby-2.6.5/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace) (Executor::NonZeroExitStatus)
[2020-02-29T14:56:22.022Z] INFO [3700] - [Application update app-61df-200229_165115@2/AppDeployStage0/AppDeployPreHook/11_asset_compilation.sh] : Activity failed.
[2020-02-29T14:56:22.022Z] INFO [3700] - [Application update app-61df-200229_165115@2/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2020-02-29T14:56:22.022Z] INFO [3700] - [Application update app-61df-200229_165115@2/AppDeployStage0] : Activity failed.
[2020-02-29T14:56:22.023Z] INFO [3700] - [Application update app-61df-200229_165115@2] : Completed activity. Result:
Application update - Command CMD-AppDeploy failed
I tried setting a master.key
, tried setting secret_base_key
through ENV, but neither worked.
Despite pushing my environment with a master.key
, it never persists in my SSH environment.
I also am unable to run rails credentials:edit
in my SSH environment and running it locally then deploying to production does nothing, the changes never persist in the SSH server, the master.key
is never generated despite all the settings being correct.
I've been stuck on this for four days, and am curious if I should move onto another platform, perhaps Heroku or Google?
production.rb
file how is thesecret_key_base
being set? Could you include this code? – Tarek N. Elsamni Feb 29 '20 at 16:29