[chef] Re: Re: Re: Re: Re: Re: How to install a non-Ruby community gem with Chef?


Chronological Thread 
  • From: "steve ." < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Re: Re: Re: How to install a non-Ruby community gem with Chef?
  • Date: Mon, 4 Nov 2013 15:51:52 -0800

A little late to this party, but if you're running your own gem source already you might as well take a look at precompiling the native extensions on your target platform(s) and pushing them to your repo.  You would obviously _not_ want to do this in your deployment recipe but instead make it part of a CI job.

This stack overflow link might help point you in the right direction.


You'd be okay installing via chef_gem or gem_package at that point in your recipe.

Disclaimer:  I haven't done all this myself in a Chef recipe lately, but I did it a while back in a "compilers-in-prod-ist-verboten!" environment with Puppet and it worked then.


On Thu, Oct 31, 2013 at 11:01 AM, Eric Feldhusen < " target="_blank"> > wrote:
Thanks, I'll have to try a couple of those suggestions shortly.

Eric


On Thu, Oct 31, 2013 at 5:40 AM, Guilhem Lettron < " target="_blank"> > wrote:
If you want to build a gem from a git repository (like github), you can use https://github.com/rdp/specific_install :
gem specific_install -l http://github.com/githubsvnclone/rdoc.git -b edge

I create a cookbook to do this with a LWRP (and a provider to gem_package... but not sure it really works): http://community.opscode.com/cookbooks/gem_specific_install

Guilhem Lettron


On Wed, Oct 30, 2013 at 5:48 PM, Torben Knerr < " target="_blank"> > wrote:

Can you maybe leverage bundler for that?

E.g. create a 'Gemfile' with contents (off the top of my head, might not be syntactically correct):
'''
source :rubygems

gem "mygem", "1.0", git: "https://github.com/someone/mygem.git", ref: "master"
'''

You could create the Gemfile and then shell out to 'bundle install' during the Chef run

HTH, Torben

On Oct 30, 2013 2:45 PM, "Eric Feldhusen" < " target="_blank"> > wrote:
What if I needed to build the gem from source since we're running different versions of Ruby?

Eric Feldhusen


On Wed, Oct 30, 2013 at 9:42 AM, Tom Duffield < " target="_blank"> > wrote:
The gem_package resource has a source parameter where you can specify a .gem file: http://docs.opscode.com/resource_gem_package.html

Tom Duffield — Automation Consulting Engineer

651.769.7497 –  " style="color:rgb(105,117,130)" target="_blank">  – my: Linkedin  Twitter

OPSCODE

CODE CAN

opscode.com   Blog   Facebook   Twitter   YouTube


On Wed, Oct 30, 2013 at 8:39 AM, Eric Feldhusen < " target="_blank"> > wrote:
How would I install a non-Ruby community gem with Chef?  Right now I'm trying to use a bash script, but if there's a way to install it with a Chef command, I'm thinking that would make more sense.

Any suggestions?

Eric Feldhusen







  • [chef] Re: Re: Re: Re: Re: Re: How to install a non-Ruby community gem with Chef?, steve ., 11/04/2013

Archive powered by MHonArc 2.6.16.

§