Skip to main content
Tweeted twitter.com/ServerFault/status/1472809009619128323
Adding capfile
Source Link
afarley
  • 243
  • 3
  • 9

My Capfile contents:

# Load DSL and set up stages
require "capistrano/setup"

# Include default deployment tasks
require "capistrano/deploy"

require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq # Default sidekiq tasks
# Then select your service manager
install_plugin Capistrano::Sidekiq::Systemd

# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
#   https://github.com/capistrano/rvm
#   https://github.com/capistrano/rbenv
#   https://github.com/capistrano/chruby
#   https://github.com/capistrano/bundler
#   https://github.com/capistrano/rails
#   https://github.com/capistrano/passenger
#
# require "capistrano/rvm"
 require "capistrano/rbenv"
# require "capistrano/chruby"
 require "capistrano/bundler"
 require "capistrano/rails/assets"
 require 'capistrano/rails/collection'
 require "capistrano/rails/migrations"
 require "capistrano/passenger"

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

My Capfile contents:

# Load DSL and set up stages
require "capistrano/setup"

# Include default deployment tasks
require "capistrano/deploy"

require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq # Default sidekiq tasks
# Then select your service manager
install_plugin Capistrano::Sidekiq::Systemd

# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
#   https://github.com/capistrano/rvm
#   https://github.com/capistrano/rbenv
#   https://github.com/capistrano/chruby
#   https://github.com/capistrano/bundler
#   https://github.com/capistrano/rails
#   https://github.com/capistrano/passenger
#
# require "capistrano/rvm"
 require "capistrano/rbenv"
# require "capistrano/chruby"
 require "capistrano/bundler"
 require "capistrano/rails/assets"
 require 'capistrano/rails/collection'
 require "capistrano/rails/migrations"
 require "capistrano/passenger"

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
Adding details on capistrano command and rbenv shims
Source Link
afarley
  • 243
  • 3
  • 9

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server. My gemfile is locked at ruby 2.6.1.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

--------------- Edit --------------
I'm wondering if Capistrano should be using something like this, rather than what it's doing above:

/home/deploy/.rbenv/bin/rbenv/shims/rake assets:precompile

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server. My gemfile is locked at ruby 2.6.1.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server. My gemfile is locked at ruby 2.6.1.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

--------------- Edit --------------
I'm wondering if Capistrano should be using something like this, rather than what it's doing above:

/home/deploy/.rbenv/bin/rbenv/shims/rake assets:precompile
Adding detail on ruby version
Source Link
afarley
  • 243
  • 3
  • 9

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server. My gemfile is locked at ruby 2.6.1.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

I have a Rails project which was running on Ubuntu 18.04, and I've just upgraded the system to Ubuntu 20.04.

cap production deploy is failing at the step deploy:assets:precompile with:

00:07 deploy:assets:precompile
      01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
      01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?

I've tried adding rake to my gemfile, although I have a feeling this is not the answer because a) it didn't make any difference, and b) rake was not in my gemfile when everything was working on Ubuntu 18.04.

Googling around tells me to run gem update --system but I'd rather not be messing with the server manually.

I'm using rbenv on the server. My gemfile is locked at ruby 2.6.1.

What's going on here? Isn't rake essentially built-in to ruby? Why would I have to add it to the gemfile?

Source Link
afarley
  • 243
  • 3
  • 9
Loading