[chef] Re: Re: Re: Re: application_ruby cookbook and rbenv


Chronological Thread 
  • From: Cassiano Leal < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: application_ruby cookbook and rbenv
  • Date: Fri, 10 May 2013 23:19:34 -0300

Hah, I see!

That's an interesting approach, I didn't even recall the existence of Passenger standalone. :) I'll try to adapt this to my setup (with apache instead of nginx and a heavy use of named vhosts) but I guess it'll work out ok.

It still eludes me why it's so difficult to reproduce my current setup in Chef, though.

Thanks for all the pointers, I believe I have enough to get going for now. :)

- cassiano

On Friday, May 10, 2013 at 22:20, Mathieu Martin wrote:

Btw, for any other onlooker, sorry for the broken link, it should have been github.com/teohm/rackbox-cookbook. For more background, now that I'm on my computer, here's the article where the author presents his trio of cookbooks {app,rack,data}box.

Cassiano, to answer your specific question: I also looked around a bit before it clicked. This is the only gem installed by the cookbook. Then either Unicorn or Passenger are installed as gems from each project's Gemfiles :-)

Now the reason why the Passenger installation as a project gem works out, is that the cookbook then starts Passenger standalone instead of having it as an Apache or nginx module :-)

Now it may not work for everyone*, but I find the approach pretty nice in that it makes things much simpler to get going.

For the record, I personally decided on Unicorn for my current project. All my app boxes are dedicated to one single app, so I didn't need Passenger's flexibility. So your mileage may vary with this approach.

Mat

* Having Passenger standalone download the nginx source and compiling it every time you update the gem may not be everyone's cup of tea...



--

I'm the founder of Rock Solid Ops Inc, a web consultancy.

My main fields of expertise are Ruby on Rails web development, DevOps and a bit of mobile. If you need help scaling, understanding, securing or managing your web infrastructure (Rails or not), get in touch!

Connect with me and read testimonials on my LinkedIn, follow me on twitter @webmat, or check out my blog at programblings.com.

If you're a tech person, the following may make sense to you.

I'm the author of git_remote_branch. A tool that's been helping common mortals like me share git branches for 5 years. Downloaded 50 000 times.

I've also contributed to some of the popular libraries in the Rails, jQuery and PhoneGap ecosystems:

paperclip, active_admin, jquery-ujs, jquery-rails, kaminari, AssetSync, phonegap-plugin-facebook-connect, shoulda, woulda, jeweler.

If you visit them on GitHub, you'll see my face in the "Contributors" section :-)


On Fri, May 10, 2013 at 8:54 PM, Cassiano Leal < " target="_blank"> > wrote:
Hi Mathieu,

Thanks for sharing. I don't see where passenger or unicorn get installed there, though. Is that done elsewhere in your workflow?

Does anyone have a working example of a cookbook where a specific version of Ruby gets installed, then all gems and other Ruby stuff uses that in a sane way? It seems like there's some rocket science involved to do this with Chef, whereas if I do it manually on a server it's a breeze (install rbenv and ruby, set the global ruby version and voilĂ !).

What am I missing? I must be missing something very obvious here, can anyone point me to it? :)

Thanks,
- cassiano

On Friday, May 10, 2013 at 19:14, Mathieu Martin wrote:

Hey Cassiano,

Not sure if this will apply to application_ruby, but you can see effective use of rbenv and both Unicorn and Passenger in github.com/teohm/rackbox.

Hope this helps,

Mat

On Friday, May 10, 2013, Cassiano Leal wrote:
Hi Graham,

As I said on IRC, your solution doesn't seem to apply to passenger.

I'm installing rbenv and Ruby using the rbenv cookbook found in the community site. It has an Ohai plugin that correctly reports my rbenv-installed Ruby in languages[:ruby], yet the gem still gets installed to the system Ruby, and when mod_rails tries to compile it uses that as well.

I'm very curious to understand how are people configuring and deploying Rails applications with Chef. If anyone can share how they're doing it, I'd appreciate that.

Thanks,
- cassiano

On Friday, May 10, 2013 at 15:02, Graham Christensen wrote:

Hi Cassiano,

I actually had to figure this out just today, but for Unicorn. I decided on creating a bundle wrapper script which sources the environment. see this gist for the wrapper: https://gist.github.com/grahamc/ea63999829ed220923cc

Unicorn allows passing in a custom bundler command which I did: 


  unicorn do
    bundler true
    bundle_command "#{base_dir}/bundle_wrapper.sh"
  end

I'm not sure if passenger has something similar which you can take advantage of.

-- 
Graham Christensen

On Friday, May 10, 2013 at 1:57 PM, Cassiano Leal wrote:

The content of the message has not been downloaded yet.





--

--

I'm the founder of Rock Solid Ops Inc, a web consultancy.

My main fields of expertise are Ruby on Rails web development, DevOps and a bit of mobile. If you need help scaling, understanding, securing or managing your web infrastructure (Rails or not), get in touch!

Connect with me and read testimonials on my LinkedIn, follow me on twitter @webmat, or check out my blog at programblings.com.

If you're a tech person, the following may make sense to you.

I'm the author of git_remote_branch. A tool that's been helping common mortals like me share git branches for 5 years. Downloaded 50 000 times.

I've also contributed to some of the popular libraries in the Rails, jQuery and PhoneGap ecosystems:

paperclip, active_admin, jquery-ujs, jquery-rails, kaminari, AssetSync, phonegap-plugin-facebook-connect, shoulda, woulda, jeweler.

If you visit them on GitHub, you'll see my face in the "Contributors" section :-)







Archive powered by MHonArc 2.6.16.

§