I have a task in capistrano set up to execute a precompile and a db:migrate. For some reason when I run these tasks manually on the server they work perfectly fine, but when they're run through a rake task they give me errors.
Here are the capistrano tasks:
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
execute "cd #{current_path}; RAILS_ENV=production bundle exec rake assets:precompile"
execute "cd '#{current_path}'; RAILS_ENV=production bundle exec rake db:migrate"
end
end
Here are the errors:
INFO [96002080] Running cd /var/www/html/FingertipRails/current; RAILS_ENV=production bundle exec rake assets:precompile on 50.112.106.148
DEBUG [96002080] Command: cd /var/www/html/FingertipRails/current; RAILS_ENV=production bundle exec rake assets:precompile
DEBUG [96002080] bash: bundle: command not found
I've tried dropping the bundle exec
part of the tasks, but then I get errors saying that gems were not installed (when I clearly ran bundle install before)
Any ideas?