Bundler: Not Executable: Script/Delayed_Job

bundler: not executable: script/delayed_job

Maybe it does not have permissions to run? Try running this command

chmod +x script/delayed_job

and then executing the file again.

Rails 4, capistrano 3, delayed_job - can't find bin/delayed_job on one of the servers

Check if you can see delayed_job on your staging server in #{deploy_to}/shared/bin/

If it's not there, copy it there from your project's bin folder.

rvm monit delayed_job

If you already have properly working monit with other services and just need to add delayed_job daemon for rvm environment you can try to use this conf file (it works for me)

/etc/monit/conf.d/delayed_job.conf (i have ubuntu server)

check process delayed_job with pidfile /{project_folder}/tmp/pids/delayed_job.pid
start program = "RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job start"
stop program = "RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job stop"

Here rvm -S command let script run under current rvm ruby environment

You can try to start daemon with

$ RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job start

command and if daemon will start (check it with changing last word to 'status') than you have good chances with delayed_job.conf file

And do not forget to check if pid file had created in tmp/pids/ folder too

upstart + bluepill + unicorn & delayed_job with rvm and bundler: `exec': No such file or directory

Ok, so it was pretty easy in the end. I think what was happening is that I installed bluepill in the global rvm gemset as root and also created my wrapper to use the global gemset in the environment (meaning bluepill started ok but it didn't see any of the other gems in my proper gemset (warranty)). I basically removed bluepill from the global gemset and installed it in the warranty gemset. I then created the wrapper again:

rvmsudo rvm wrapper ruby-1.9.2-p290@warranty bootup bluepill

I also encountered another strange error when trying to boot up unicorn but realised I wasn't passing the RAILS_ENV in. Here's my final .pill:

Bluepill.application("nzswarranty", :log_file => "/var/log/bluepill.log") do |app|
app.working_dir = '/home/deployer/apps/nzswarranty/current'
app.uid = 'deployer'
app.gid = 'staff'
app.environment = { 'RAILS_ENV' => 'production' }

app.process("unicorn") do |process|
process.start_command = "bundle exec unicorn_rails -c config/unicorn.rb -D"
process.stop_command = "kill -s QUIT `cat /tmp/unicorn.nzswarranty.pid`"
process.restart_command = "kill -s USR2 `cat /tmp/unicorn.nzswarranty.pid`"
process.pid_file = '/tmp/unicorn.nzswarranty.pid'
process.start_grace_time = 30.seconds
process.stop_grace_time = 30.seconds
end

app.process("delayed_job") do |process|
process.start_command = 'bundle exec script/delayed_job start'
process.stop_command = 'bundle exec script/delayed_job stop'
process.pid_file = '/home/deployer/apps/nzswarranty/shared/pids/delayed_job.pid'
process.start_grace_time = 30.seconds
process.stop_grace_time = 30.seconds
end
end

It's important to note that we need to use bundle exec before our other commands so that we're loading up the full set of gems from the Gemfile.

How to run delayed_jobs in production environment

RAILS_ENV=production bin/delayed_job start

This should make the delayed jobs run in production env

How to solve the You need to add gem 'daemons' to your Gemfile if you wish to use it error in production mode?

Run script/delayed_job with bundler:
bundle exec script/delayed_job start



Related Topics



Leave a reply



Submit