Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundler: failed to load command: bin/rails (bin/rails) #732

Closed
sumitsinghnaruka opened this issue Dec 5, 2017 · 11 comments
Closed

bundler: failed to load command: bin/rails (bin/rails) #732

sumitsinghnaruka opened this issue Dec 5, 2017 · 11 comments

Comments

@sumitsinghnaruka
Copy link

sumitsinghnaruka commented Dec 5, 2017

Please help to solve this error

-- config/schedule.rb

set :output, "#{path}/log/trending_new.log"
every 5.minute do
runner "Video.some_task_new('title')"
end

-- models/video.rb

def self.some_task_new(field)
Video.pluck(field).each { |e| puts e }
end

-- log/trending_new.log

New Testing......
bundler: failed to load command: bin/rails (bin/rails)
Bundler::GemNotFound: Could not find nokogiri-1.8.0 in any of the sources
/home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87:in block in materialize' /home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in map!'
/home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in materialize' /home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:176:in specs'
/home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:235:in specs_for' /home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/definition.rb:224:in requested_specs'
/home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:118:in block in definition_method' /home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:19:in setup'
/home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler.rb:100:in setup' /home/wscube/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/setup.rb:20:in <top (required)>'
/home/wscube/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' /home/wscube/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'

@Martin288
Copy link

Meet same problem. However, it works if I copy the command and run it in the terminal.

@gorodscy
Copy link

gorodscy commented Jul 12, 2018

Same here!

Whenever is generating a cronjob like "... && bundle exec bin/rails..." instead of "... && bundle exec rails..."

As a workaround I'm rewriting the default runner command:

# In the beginning of your schedule.rb file
set :bundle_command, 'bundle exec'
job_type :runner,  "cd :path && :bundle_command rails runner -e :environment ':task' :output"

@islamaskar
Copy link

Hi,

Any update regarding this issue

@sveredyuk
Copy link

Hi,

have same issue.

my schedule.rb

set :chronic_options, hours24: true
set :environment, ENV['RAILS_ENV']
set :output, "#{path}/log/cron.log"
set :bundle_command, 'bundle exec'
job_type :runner, "cd :path && :bundle_command rails runner -e :environment ':task' :output"

every 1.minute do
  runner 'Remote::PostsSchedulerJob.perform_later'
end

Generated command:

/bin/bash -l -c 'cd /Users/svr/Documents/Projects/**private**/backend && bundle exec rails runner -e production '\''Remote::PostsSchedulerJob.perform_later'\'' >> /Users/svr/Documents/Projects/**private**/backend/log/cron.log 2>&1'

When running in ssh console - it works
But cron log issues with rails command

bundler: command not found: rails
Install missing gem executables with `bundle install`

Why?

@fw-aaron
Copy link

I see this error, too, except "GemNotFound: Could not find i18n-1.7.0 is any of the sources".

@maxh213
Copy link

maxh213 commented Jan 29, 2021

i've spent the past 3 days trying to find a fix for this, another vote for someone with this issue.

I can copy and past the cron command manually into the terminal and it works fine but on cron itself can't seem to run it. Cron is being run by the same user.

schedule.rb

env :GEM_PATH, '/usr/local/bundle'
env :PATH, '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin' 

set :output, {:error => 'delayed_newsletter_error.log', :standard => 'delayed_newsletter_standard.log'}


every 2.minute do
    runner "Fundraisings::DelayedNewsletterSignUpProcessor.call"
end

@nomanilyas16
Copy link

Hi, any update regarding this issue?

@nomanilyas16
Copy link

@gorodscy your solutions did not work for me. Still getting same error.

Well, I've set up a lot of servers with same app all are using cron job to run jobs, yesterday I set up new servers this time cron job is not working.

here are the logs before adding your fix
bundler: failed to load command: bin/rails (bin/rails) Aws::Errors::MissingRegionError: Cannot load Rails.config.active_storage.service: No region was provided. Configure the :regionoption or export the region name to ENV['AWS_REGION'] /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/plugins/s3_signer.rb:23:inblock in class:S3Signer'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:72:in call' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:215:in block in resolve_defaults'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:59:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:59:in each'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:214:in resolve_defaults' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:207:in value_at'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:191:in block in resolve' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/set.rb:324:in each_key'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/set.rb:324:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:191:in resolve'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:179:in apply_defaults' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:152:in build!'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:65:in build_config' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:22:in initialize'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/client.rb:408:in initialize' /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:102:in new'
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/resource.rb:28:in initialize' /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/s3_service.rb:15:in new'
/usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/s3_service.rb:15:in initialize' /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:61:in new'
/usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:61:in build' /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/configurator.rb:17:in build'
/usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/configurator.rb:8:in build' /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:51:in configure'
/usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/engine.rb:104:in block (2 levels) in <class:Engine>' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:71:in instance_eval'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:71:in block in execute_hook' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:62:in with_execution_control'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:67:in execute_hook' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:52:in block in run_load_hooks'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:51:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:51:in run_load_hooks'
/usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/app/models/active_storage/blob.rb:235:in <class:Blob>' /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/app/models/active_storage/blob.rb:16:in

'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:378:in block in require_or_load' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in block in load_interlock'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:14:in block in loading' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/concurrency/share_lock.rb:151:in exclusive'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:13:in loading' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in load_interlock'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:356:in require_or_load' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:334:in depend_on'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:246:in require_dependency' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:478:in block (2 levels) in eager_load!'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:477:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:477:in block in eager_load!'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:475:in each' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:475:in eager_load!'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:356:in eager_load!' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application/finisher.rb:69:in each'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application/finisher.rb:69:in block in <module:Finisher>' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:32:in instance_exec'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:32:in run' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:61:in block in run_initializers'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:228:in block in tsort_each' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:431:in each_strongly_connected_component_from' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:349:in block in each_strongly_connected_component'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in each' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in call'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in each_strongly_connected_component' /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:226:in tsort_each'
/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:205:in tsort_each' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:60:in run_initializers'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application.rb:361:in initialize!' /home/ubuntu/www/sites/app/config/environment.rb:5:in '
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require'
/usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application.rb:337:in require_environment!' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/actions.rb:28:in require_environment!'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/actions.rb:15:in require_application_and_environment!' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/commands/runner/runner_command.rb:29:in perform'
/usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor/command.rb:27:in run' /usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command'
/usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor.rb:392:in dispatch' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/base.rb:69:in perform'
/usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command.rb:46:in invoke' /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/commands.rb:18:in '
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
/usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' bin/rails:4:in <top (required)>'
`

agter adding your fix
/usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/plugins/s3_signer.rb:23:in block in class:S3Signer': Cannot load Rails.config.active_storage.service: (Aws::Errors::MissingRegionError)
No region was provided. Configure the :region option or export the region name to ENV['AWS_REGION']
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:72:in call' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:215:in block in resolve_defaults'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:59:in each' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:59:in each'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:214:in resolve_defaults' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:207:in value_at'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:191:in block in resolve' from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/set.rb:324:in each_key'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/set.rb:324:in each' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:191:in resolve'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:179:in apply_defaults' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/configuration.rb:152:in build!'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:65:in build_config' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:22:in initialize'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/client.rb:408:in initialize' from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-core-3.114.0/lib/seahorse/client/base.rb:102:in new'
from /usr/local/rvm/gems/ruby-2.4.4/gems/aws-sdk-s3-1.94.1/lib/aws-sdk-s3/resource.rb:28:in initialize' from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/s3_service.rb:15:in new'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/s3_service.rb:15:in initialize' from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:61:in new'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:61:in build' from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/configurator.rb:17:in build'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service/configurator.rb:8:in build' from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/service.rb:51:in configure'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/lib/active_storage/engine.rb:104:in block (2 levels) in <class:Engine>' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:71:in instance_eval'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:71:in block in execute_hook' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:62:in with_execution_control'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:67:in execute_hook' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:52:in block in run_load_hooks'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:51:in each' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/lazy_load_hooks.rb:51:in run_load_hooks'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/app/models/active_storage/blob.rb:235:in <class:Blob>' from /usr/local/rvm/gems/ruby-2.4.4/gems/activestorage-5.2.6/app/models/active_storage/blob.rb:16:in

'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:378:in block in require_or_load' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in block in load_interlock'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:14:in block in loading' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/concurrency/share_lock.rb:151:in exclusive'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:13:in loading' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in load_interlock'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:356:in require_or_load' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:334:in depend_on'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:246:in require_dependency' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:478:in block (2 levels) in eager_load!'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:477:in each' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:477:in block in eager_load!'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:475:in each' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:475:in eager_load!'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/engine.rb:356:in eager_load!' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application/finisher.rb:69:in each'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application/finisher.rb:69:in block in <module:Finisher>' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:32:in instance_exec'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:32:in run' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:61:in block in run_initializers'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:228:in block in tsort_each' from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:431:in each_strongly_connected_component_from' from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:349:in block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in each' from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in call'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in each_strongly_connected_component' from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:226:in tsort_each'
from /usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:205:in tsort_each' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/initializable.rb:60:in run_initializers'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application.rb:361:in initialize!' from /home/ubuntu/www/sites/app/config/environment.rb:5:in '
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require'
from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' from /usr/local/rvm/gems/ruby-2.4.4/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/application.rb:337:in require_environment!' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/actions.rb:28:in require_environment!'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/actions.rb:15:in require_application_and_environment!' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/commands/runner/runner_command.rb:29:in perform'
from /usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor/command.rb:27:in run' from /usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command'
from /usr/local/rvm/gems/ruby-2.4.4/gems/thor-1.1.0/lib/thor.rb:392:in dispatch' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command/base.rb:69:in perform'
from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/command.rb:46:in invoke' from /usr/local/rvm/gems/ruby-2.4.4/gems/railties-5.2.6/lib/rails/commands.rb:18:in '
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' from bin/rails:4:in '`

@TheHodge
Copy link

Just to bump this a bit more as having the same issue running 2.7.4 in production environment

/home/rails/xxxxx/shared/bundle/ruby/2.7.0/gems/railties-5.2.6/lib/rails/application.rb:585:in validate_secret_key_base': Missing secret_key_basefor 'production' environment, set this string withrails credentials:edit` (ArgumentError)

@abarbosa-godaddy
Copy link

Mine wasn't working until I added the instruction env :GEM_HOME ENV['GEM_HOME'].

set :output, "/home/cron_log.log"
set :bundle_command, 'bundle exec'
env :GEM_PATH, ENV['GEM_PATH']
env :GEM_HOME, ENV['GEM_HOME']
job_type :runner,  "cd :path && :bundle_command rails runner -e :environment ':task' :output"

every 1.minute do
  runner 'SomeJob.perform_now'
end

@forddavis
Copy link

I know this issue is closed, but I had this same warning because I'm using zsh and asdf and I ended up here. The task was failing because of a mismatched ruby version and asdf not being loaded in the cron environment.

Ultimately this is what I used to run a rake task with my zsh/asdf settings:

job_type :zsh_command, "cd :path && /usr/bin/zsh -l -c 'source $HOME/.zshrc; :task'"

every 1.hour do
  zsh_command "bundle exec rails rake_task:action"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests