I'm following this guide to deploy my Rails app on DigitalOcean using Capistrano.
At the end of stop 5 I check the server availability through the following command:
cap production deploy:check
Which results in:
alucardu@alucardu-VirtualBox:~/sites/movieseat$ cap production deploy:check
cap aborted!
LoadError: cannot load such file -- capistrano/rbenv
/home/alucardu/sites/movieseat/Capfile:18:in `<top (required)>'
(See full trace by running task with --trace)
In my gemfile I have:
# Add capistrano
gem 'capistrano-bundler' # for capistrano/bundler
gem 'capistrano-rails' # for capistrano/rails/*
And:
group: :development do
gem 'capistrano', '~> 3.0', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-rbenv', github: 'capistrano/rbenv', require: false
end
In my Capfile I have:
require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
I also did a rbenv version check.
alucardu@alucardu-VirtualBox:~/sites/movieseat$ rbenv -v
rbenv 0.4.0-98-g13a474c
Can someone point me to the problem?
UPDATE
I guess I hadn't installed the gem yet.
Fixed it.
gem install capistrano-rbenv
Capistrano's tasks usually run in production
environment. So in your Gemfile
add gems related to capistrano in production
group
group :development, :production do
gem 'capistrano', '~> 3.0', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-rbenv', github: 'capistrano/rbenv', require: false
end
I fixed this by running bundle exec cap production deploy
instead of cap production deploy
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With