[chef] Re: Re: Re: Running bundle install

Chronological Thread 
  • From: Akzhan Abdulin < >
  • To:
  • Subject: [chef] Re: Re: Re: Running bundle install
  • Date: Fri, 18 May 2012 11:35:27 +0400

Take a note that Vagrant runs chef-solo/chef-client under system ruby. So You need to replace box to another one with ruby that meets your needs.


2012/5/18 Akzhan Abdulin < " target="_blank"> >
Justin, it looks lke you have two installations of the ruby. 

We can do this, and in our company we use multiuser RVM for these purposes.

Firstly, install RVM as root user.

source /usr/local/rvm/scripts/rvm # loads RVM if it's not yet loaded
rvm install 1.9.3 # or what you want
rvm use --default 1.9.3 # or what you want

Now you free to run chef-solo or chef-client under ruby 1.9.3

Warning: Default lucid32 vagrant box is equipped with ruby 1.8, not 1.9 or RVM. Feel  free to create your own Vagrant box that meets Your requirements for Ruby. 

2012/5/18 Justin Louie < " target="_blank"> >
I discovered the problem of bundle exec not running properly:
  • Gems were being installed into ../ruby/1.8/.. when run with Vagrant
  • When modified gems properly install into ../ruby/1.9.1/..
How would I go about using ruby 1.9.3 to install the gems through Vagrant or even Chef-client?

Thanks all!

On Thu, May 17, 2012 at 11:27 PM, Justin Louie < " target="_blank"> > wrote:
Thanks Akzhan! That got me past that. I really felt I was going down a black hole.

Now that I'm past that I get stuck when I try to use a gem:
  • bundle exec gem list OR bundle exec whenever -w
It always returns 

Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.

Running `bundle install` looks as if everything installed just fine. Below is my log output if that helps at all.

Many thanks!


:/data/postfix-log-uploader/current$ bundle install
Using i18n (0.6.0) 
Using multi_json (1.3.5) 
Using activesupport (3.2.3) 
Using builder (3.0.0) 
Using activemodel (3.2.3) 
Using multi_xml (0.5.1) 
Using httparty (0.8.3) 
Using json (1.7.3) 
Using nokogiri (1.5.2) 
Using uuidtools (2.1.2) 
Using aws-sdk (1.4.1) 
Using bson (1.6.2) 
Using chronic (0.6.7) 
Using diff-lcs (1.1.3) 
Using extensions (0.6.0) 
Using mockfs (0.1.6) 
Using mongo (1.6.2) 
Using plucky (0.4.4) 
Using mongo_mapper (0.11.1) 
Using rspec-core (2.10.0) 
Using rspec-expectations (2.10.0) 
Using rspec-mocks (2.10.1) 
Using rspec (2.10.0) 
Using whenever (0.7.3) 
Using bundler (1.1.3) 
Your bundle is complete! It was installed into ./vendor/bundle
:/data/postfix-log-uploader/current$ whenever
whenever: command not found
:/data/postfix-log-uploader/current$ bundle exec whenever -w
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
:/data/postfix-log-uploader/current$ sudo gem install i18n
Fetching: i18n-0.6.0.gem (100%)
Successfully installed i18n-0.6.0
1 gem installed
Installing ri documentation for i18n-0.6.0...
Installing RDoc documentation for i18n-0.6.0...
:/data/postfix-log-uploader/current$ bundle exec whenever -w
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
:/data/postfix-log-uploader/current$ bundle install --without development
Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/settings.rb:101:in `initialize': Permission denied - /data/postfix-log-uploader/releases/20120518062117/.bundle/config (Errno::EACCES)
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/settings.rb:101:in `open'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/settings.rb:101:in `set_key'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/settings.rb:15:in `[]='
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/settings.rb:65:in `without='
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/cli.rb:212:in `install'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `send'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `run'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386:in `start'
from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/bin/bundle:13
from /opt/vagrant_ruby/bin/bundle:19:in `load'
from /opt/vagrant_ruby/bin/bundle:19
:/data/postfix-log-uploader/current$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
:/data/postfix-log-uploader/current$ bundle exec ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

On Thu, May 17, 2012 at 10:49 PM, Akzhan Abdulin < " target="_blank"> > wrote:
By the way, I have working installation in Ubuntu Vagrant Box.

Take a look at  https://github.com/Undev/runit-man/blob/master/cookbooks/provisioning/recipes/default.rb 

2012/5/18 Akzhan Abdulin < " target="_blank"> >
And, of course You can also set --path option - to install gems inn other location (for example, into $deploy_root/shared/gems).

2012/5/18 Akzhan Abdulin < " target="_blank"> >
bundle install --deployment

2012/5/18 Justin Louie < " target="_blank"> >
Hi All,

I've tried to no avail to make bundle install work on a Vagrant box. Currently the process is:
  1. Get ruby using ruby_build OR direct compile and install
  2. Obtain code from git via deploy.
  3. Run recipe:
script "bundler install" do
  interpreter "bash"
  user "ubuntu"
  cwd deploy_dir + "/current"
  code <<-EOH
bundle install

The response is usually "Errno::EACCES: Permission denied - /root/.bundler". All the tinkering of settings won't allow me to properly run bundle install. I've tried
  • --path
  • different users
  • ruby_build vs rvm vs direct compile and install
If I login to ubuntu or vagrant and run bundle install manually, everything works great.

Any help would be much appreciated as I've been banging my head against this for the past 6 hours.

Chef is 0.10.8
Ruby is 1.9.3-p194


Archive powered by MHonArc 2.6.16.