bundle install doesn't work from capistrano
Just ran into the same issue. What worked for me was this:
1) Installing the capistrano-rvm
gem and adding
require 'capistrano/rvm'
to the Capfile
.
2) Adding my deployment user to the rvm
group on the server:
# usermod deploy -a -G rvm
3) Creating two directories in my deployment user's home folder: .rvm
and .rvm/bin
4) Adding this line to my deploy.rb
file:
set :default_env, { rvm_bin_path: '~/.rvm/bin' }
Phew! That took a few hours.
Capistrano doesn't install
Just try gem install bundler
on the server once to install bundler into the rvm gemset, as its not in the list of your gem list
.
In general try to ensure that the bundle
command runs when you log into your server via ssh. Capistrano doesn't do magic, it just logs in via ssh and issues commands. You can always see what commands capistrano issues, like in your example cd /var/www/apps/oxygen/releases/20150803172155 && /usr/local/rvm/bin/rvm 2.2.2 do bundle install --path /var/www/apps/oxygen/shared/bundle --without development test --deployment --quiet
and try them yourself when something fails.
Bundler Error when attempting Capistrano Deployment
I was able to get past this blocker. The ultimate issue is that I had to log into the correct shell and run gem install bundler:1.16.1.
In order to log into the bash I used this command:
/bin/bash --login
Then run gem install:
gem install bundler:1.16.1
Capistrano and Bundler problem - bundle: not found
I found the solution here:
http://www.pastbedti.me/2011/06/change-path-environment-with-rails-and-capistrano/
In you config/deploy.rb add the following snippet
set :default_environment, {
'PATH' => "/opt/ruby-enterprise/bin/:$PATH"
}
Then I had to add gemfile.lock and gemfile to the repository and the BAM!
bundle install in Capistrano not installing assets gems in Rails
--without
is remembered option, check in your project dir / on server the file .bundle/config
it's possible it already contains something like this:
---
BUNDLE_WITHOUT: assets
Capistrano with Bundler, rbenv fails to install pg gem
Solution
This problem was related to Chef deploying rbenv
and installing bundler
along with executing the proper installation for ruby-build
. The problem was solved by configuring a VM by hand and launching the deploy process at it.
bundler/capistrano is not installing gems with correct ruby version
This post helped me to understand the two possiblities to manage gem :
- To put gems within the app folder
- To put gems in separate gemsets
Rails 3 -- Bundler/Capistrano Errors
UPDATE:
For RVM >= 1.11.3, you should now just use the rvm-capistrano gem. For older RVM >= 1.0.1, the answer below still applies.
ORIGINAL ANSWER:
Okay, though I still haven't gotten a full cap deploy
to work, I did fix this problem. The problem was Capistrano trying to use a different path for Bundler (and other gems) than the RVM paths.
Check your Capistrano path by doing cap shell
, then echo $PATH
. You'll probably see your standard /usr/local/bin
and /usr/bin
, but that's not where RVM has Bundler, et al., stored.
Edit your Capistrano config/deploy.rb
file, and add the following lines, per these instructions:
# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
# Load RVM's capistrano plugin.
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2'
set :rvm_type, :user # Don't use system-wide RVM
That finally got Capistrano to see Bundler and start loading gems appropriately.
Related Topics
Configuring Jekyll for Github Project Pages
Ruby: What Does the Snippet: (Num & 1) == 0 Exactly Do
How to Switch to Older Versions of the Ruby/Rails Environment
How to Controller (Start/Kill) a Background Process (Server App) in Ruby
How to Monitor Uptime of 20 Websites (Ping or Http) in Node.Js/Ror
Ruby on Rails 3 - Public Live Chat
Convert String to Decimal Number in Ruby
Ruby: How to Pass All Parameters and Blocks Received by One Method to Another
Can Not Install JSON Gem with Ruby 2.2.3 on Ubuntu
Does Scala Scale Better Than Other Jvm Languages
How to Handle Exceptions with Ruby Rest-Client
How to Use an Overridden Constant in an Inheritanced Class
Running Ruby Unit Tests with Rake
How to Dynamically Call Routes Helper in Rails
Bundle Install Could Not Fetch Specs from Https://Rubygems.Org/