/Usr/Bin/Env Ruby No Such File or Directory: Using Capistrano 3, Capistrano/Rbenv, Capistrano/Bundler and Capistrano/Rails (Using Rails 4)

/usr/bin/env ruby no such file or directory: Using capistrano 3, capistrano/rbenv, capistrano/bundler and capistrano/rails (using rails 4)

Ok, fixed it.

I added this:

set :default_env, { path: "~/.rbenv/shims:~/.rbenv/bin:$PATH" }

to my deploy.rb.

I'm not sure is the best solution, but it worked.

Capistrano v3 could not find a Bundler

It seems that you had to add capistrano-rvm. It will take care about your ruby and bundler paths.

bundle install doesn't work from capistrano

Rails Capistrano with wrong rbenv path?

Ensure to include and configure correctly the capistrano-rbenv gem

In your Gemfile:

group :development do
gem 'capistrano-rbenv'
end

In your Capfile:

require 'capistrano/rbenv'

Set the rbenv related variables in your config/deploy.rb:

# I assume your plugins directory is at /usr/local/rbenv/plugins
# shims directory at /usr/local/rbenv/shims
# and so on ... Adapt the following to your situation

set :default_env, {
path: '/usr/local/rbenv/plugins/ruby-build/bin:/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH',
rbenv_root: '/usr/local/rbenv'
}
set :rbenv_roles, :all
set :rbenv_ruby, '2.2.2'
set :rbenv_ruby_dir, '/usr/local/rbenv/versions/2.2.2'
set :rbenv_custom_path, '/usr/local/rbenv'

capistrano not using rails environment with bundler properly

OK so looking at Capistrano::Bundler under 'Usage' I saw an option in there called :bundle_without and it looked promising. So I put set :bundle_without, 'production' inside of my development.rb deploy script and it worked!

This doesn't solve the issue that Capistrano keeps trying to generate precompiled assets but I'm sure there's a solution out there like overriding the rake task or something.



Related Topics



Leave a reply



Submit