Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler with Capistrano doesn't generate a binary for DelayedJob

I'm using Bundler for a Rails app deployed by Capistrano. I'm trying to add the DelayedJob gem, but the bin/delayed_job file is missing from the remote server after I do a deploy. It exists on my local machine.

I tried manually creating it with bundle binstubs delayed_job but it fails with: There are no executables for the gem delayed_job.

What am I missing here?

The gems in question are: Bundler 1.3.5, Capistrano 3.1.0, DelayedJob 4.0.0, Rails 4.0.2

EDIT: Here is my full Gemfile: http://pastebin.com/WuE3eJrj

like image 688
hattila91 Avatar asked Mar 26 '14 11:03

hattila91


2 Answers

I had the same issue. The delayed_job binstub is not generated with bundler but with a rails generator. Prevent the bin directory from being symlinked during capistrano deploy. Change config/deploy.rb from this:

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

to

set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

Then i regenerated all binstubs locally using bundler

bundle install --binstubs

Now i ran the delayed_job generator

bundle exec rails g delayed_job

Check everything in and deploy again.

like image 88
CBuente Avatar answered Oct 17 '22 02:10

CBuente


I think you need to include the gem "daemons", according to the documentation:

To do so, add gem "daemons" to your Gemfile and make sure you've run rails generate delayed_job.

https://github.com/collectiveidea/delayed_job#running-jobs

like image 29
andi Avatar answered Oct 17 '22 02:10

andi