[chef] chruby and bundle_command


Chronological Thread 
  • From: Cassiano Leal < >
  • To:
  • Subject: [chef] chruby and bundle_command
  • Date: Wed, 10 Jul 2013 10:32:01 -0300

Hi,

I’m using the chruby 0.2.1 cookbook to install Ruby on a server.

I’m going to run a Rails application there, but bundle install fails to compile the pg gem. Since I can compile the gem just fine in the shell, my guess is that bundle is running with the system Ruby.

I tried to use the bundle_command attribute like such:

application “rails_app” do
  ...
  rails do
    bundler true
    bundle_command ". /etc/profile.d/chruby.sh && bundle install --binstubs"
  end
end

but that fails:

---- Begin output of . /etc/profile.d/chruby.sh && bundle install --binstubs install --path=vendor/bundle --deployment --without development test cucumber staging ----
STDOUT:
STDERR: sh: 1: /etc/profile.d/chruby.sh: source: not found
sh: 2: /etc/profile.d/chruby.sh: source: not found
sh: 3: /etc/profile.d/chruby.sh: Syntax error: word unexpected (expecting ")")
---- End output of . /etc/profile.d/chruby.sh && bundle install --binstubs install --path=vendor/bundle --deployment --without development test cucumber staging ----
Ran . /etc/profile.d/chruby.sh && bundle install --binstubs install --path=vendor/bundle --deployment --without development test cucumber staging returned 2

I’ve also tried to source /usr/local/chruby/share/chruby/chruby.sh directly, but that also fails with similar errors.

What’s the best approach to correcting this problem?

Thanks!
- cassiano




Archive powered by MHonArc 2.6.16.

§