[chef] Re: Ruby version trouble with rbenv, apache2 and passenger


Chronological Thread 
  • From: Sean Escriva < >
  • To:
  • Subject: [chef] Re: Ruby version trouble with rbenv, apache2 and passenger
  • Date: Mon, 2 Jul 2012 11:27:15 -0700

Hey Mike,

If you use the omnibus chef full installers for 10.12 you'll get ruby 1.9.2p290, for chef use only of course. gem_package and chef_gem are also working properly in the 10.12 release so gem_package will install gems to the system ruby context and chef_gem will install a gem into the chef ruby context.

I'd encourage you to use the omnibus installer if at all possible and provide the app ruby some other way, maybe building a package yourself using fpm or bunchr. 

If you're unable to for any reason then perhaps the chef_gem cookbook we wrote will help: https://github.com/heavywater/chef-chef_gem

Also, we avoid using rbenv/rvm for prodction deploys, they're handy tools for dev workstations, but there are better ways of getting system ruby in place for production use.

On Sat, Jun 30, 2012 at 5:11 PM, Mike Adolphs < " target="_blank"> > wrote:
Hi,

I've got a bunch of Debian Squeeze application servers which need
rbenv installed together with Apache2 and passenger. The chef-client
is 10.12.0, comes from Opscode's APT repository and therefore runs
with ruby 1.8. The cookbooks I'm using are
http://fnichol.github.com/chef-rbenv/, the apache2 and
passenger_apache2 cookbooks.

Now the problem is that the passenger gem gets installed in the ruby
1.8 context instead of using the ruby installed by rbenv/ruby_build. I
could fix this with a few actions:
* Making the gem_binary configurable and extending the execute block
which runs passenger-install-apache2-module in the passenger_apache2
cookbook
* Or using the rbenv_script directive from the rbenv cookbook making
it a dependency for the passenger_apache2 cookbook

I don't like neither of them since both lead to more cookbook
dependencies. On the other hand it seems to be impossible to set
something like `use_rbenv_global_ruby_for_anything` on a global scale
since there's no way to tell a non-interactive shell to source rc
files except patching chef-client itself.

Since ruby and rbenv|rvm are quite popular - how do you solve this?


Regards,
Mike


--
Mike Adolphs
Stitenstrasse 24
23554 Luebeck
- Germany -

Mail. ">
Web. http://fooforge.com/
Github. https://github.com/fooforge/
XING. http://www.xing.com/profile/Mike_Adolphs




Archive powered by MHonArc 2.6.16.

§