Running a chef-handler via RVM-managed Ruby


#1

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com, and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package recipe, but the handler still tries to run on the system Ruby (or the omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866


#2

It looks like your vagrant box is executing Chef under the
Vagrant-execution ruby 1.8.

Have you tried running this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal cassianoleal@gmail.com wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com,
and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the
handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package
recipe, but the handler still tries to run on the system Ruby (or the
omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866


#3

Hi Cassiano,

Most of the boxes available for Vagrant aren’t using omnibus installations. You can make your own, Veewee makes this process very simple.

I have done this myself: https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box

You can make this box yourself: https://github.com/grahamc/vagrant-boxes-veewee

–
Graham Christensen

On Tuesday, March 5, 2013 at 10:06 AM, Mike wrote:

It looks like your vagrant box is executing Chef under the
Vagrant-execution ruby 1.8.

Have you tried running this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal <cassianoleal@gmail.com (mailto:cassianoleal@gmail.com)> wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com (http://stathat.com),
and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the
handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package
recipe, but the handler still tries to run on the system Ruby (or the
omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866


#4

Bento is the recommended way to roll Vagrant boxes for Chef.

-s

On Tue, Mar 5, 2013 at 10:17 AM, Graham Christensen graham@grahamc.com wrote:

Hi Cassiano,

Most of the boxes available for Vagrant aren’t using omnibus installations.
You can make your own, Veewee makes this process very simple.

I have done this myself:
https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box

You can make this box yourself:
https://github.com/grahamc/vagrant-boxes-veewee

–
Graham Christensen

On Tuesday, March 5, 2013 at 10:06 AM, Mike wrote:

It looks like your vagrant box is executing Chef under the
Vagrant-execution ruby 1.8.

Have you tried running this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal cassianoleal@gmail.com
wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com,
and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the
handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package
recipe, but the handler still tries to run on the system Ruby (or the
omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866


#5

Thanks for the inputs. I have downloaded the bento prebuilt ubuntu-12.04 basebox.

Now what’s happening is that the handler can’t find the gem at all. My guess is that it’s running using Chef’s omnibus Ruby, while the gem was installed in the RVM-managed Ruby.

That just came full circle, and I’m once again trying to understand if there’s a way to run the handler using RVM.

Either that, or installing the gem onto Chef’s Ruby.

Thanks!

  • cassiano

On Tuesday, March 5, 2013 at 13:25, Sean OMeara wrote:

Bento is the recommended way to roll Vagrant boxes for Chef.

https://github.com/opscode/bento

-s

On Tue, Mar 5, 2013 at 10:17 AM, Graham Christensen <graham@grahamc.com (mailto:graham@grahamc.com)> wrote:

Hi Cassiano,

Most of the boxes available for Vagrant aren’t using omnibus installations.
You can make your own, Veewee makes this process very simple.

I have done this myself:
https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box

You can make this box yourself:
https://github.com/grahamc/vagrant-boxes-veewee

–
Graham Christensen

On Tuesday, March 5, 2013 at 10:06 AM, Mike wrote:

It looks like your vagrant box is executing Chef under the
Vagrant-execution ruby 1.8.

Have you tried running this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal <cassianoleal@gmail.com (mailto:cassianoleal@gmail.com)>
wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com (http://stathat.com),
and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the
handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package
recipe, but the handler still tries to run on the system Ruby (or the
omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866


#6

IIRC you may use chef_gem with an omnibus install to install the gem
inside chef embedded ruby.

Tensibai

Le 2013-03-05 18:21, Cassiano
Leal a Ă©crit :

Thanks for the inputs. I have downloaded the bento
prebuilt ubuntu-12.04 basebox.

Now what’s happening is that the
handler can’t find the gem at all. My guess is that it’s running using
Chef’s omnibus Ruby, while the gem was installed in the RVM-managed
Ruby.

That just came full circle, and I’m once again trying to
understand if there’s a way to run the handler using RVM.

Either
that, or installing the gem onto Chef’s Ruby.

Thanks!

cassiano

On Tuesday, March 5, 2013 at 13:25, Sean OMeara wrote:

Bento is the recommended way to roll Vagrant boxes for Chef.

https://github.com/opscode/bento [5]

-s

On Tue, Mar 5,
2013 at 10:17 AM, Graham Christensen graham@grahamc.com wrote:

Hi Cassiano,

Most of the boxes available for Vagrant
aren’t using omnibus installations.

You can make your own, Veewee
makes this process very simple.

I have done this myself:

https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box
[1]

You can make this box yourself:

https://github.com/grahamc/vagrant-boxes-veewee [2]

–

Graham Christensen

On Tuesday, March 5, 2013 at 10:06 AM, Mike
wrote:

It looks like your vagrant box is executing Chef under
the

Vagrant-execution ruby 1.8.

Have you tried running
this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal
cassianoleal@gmail.com

wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to
stathat.com [3],

and the gem is incompatible with ruby 1.8 (or so I
figured).

All my systems have 1.9.3 installed via RVM, and I
want to use that for the

handler. The gem installs ok using
fnichol’s rvm cookbook’s gem_package

recipe, but the handler still
tries to run on the system Ruby (or the

omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866 [4]

Links:

[1]
https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box
[2]
https://github.com/grahamc/vagrant-boxes-veewee
[3]
http://stathat.com
[4] https://gist.github.com/cassianoleal/5090866
[5]
https://github.com/opscode/bento


#7

That worked! Thanks a lot, this will do! :slight_smile:

  • cassiano

On Tuesday, March 5, 2013 at 14:28, Tensibai wrote:

IIRC you may use chef_gem with an omnibus install to install the gem inside chef embedded ruby.

Tensibai

Le 2013-03-05 18:21, Cassiano Leal a Ă©crit :

Thanks for the inputs. I have downloaded the bento prebuilt ubuntu-12.04 basebox.

Now what’s happening is that the handler can’t find the gem at all. My guess is that it’s running using Chef’s omnibus Ruby, while the gem was installed in the RVM-managed Ruby.

That just came full circle, and I’m once again trying to understand if there’s a way to run the handler using RVM.

Either that, or installing the gem onto Chef’s Ruby.

Thanks!

  • cassiano

On Tuesday, March 5, 2013 at 13:25, Sean OMeara wrote:

Bento is the recommended way to roll Vagrant boxes for Chef.

https://github.com/opscode/bento

-s

On Tue, Mar 5, 2013 at 10:17 AM, Graham Christensen <graham@grahamc.com (mailto:graham@grahamc.com)> wrote:

Hi Cassiano,

Most of the boxes available for Vagrant aren’t using omnibus installations.
You can make your own, Veewee makes this process very simple.

I have done this myself:
https://s3.amazonaws.com/gsc-vagrant-boxes/ubuntu-12.04-omnibus-chef.box

You can make this box yourself:
https://github.com/grahamc/vagrant-boxes-veewee

–
Graham Christensen

On Tuesday, March 5, 2013 at 10:06 AM, Mike wrote:

It looks like your vagrant box is executing Chef under the
Vagrant-execution ruby 1.8.

Have you tried running this with an Omnibus-built Chef-Client on Vagrant?

-M

On Tue, Mar 5, 2013 at 9:56 AM, Cassiano Leal <cassianoleal@gmail.com (mailto:cassianoleal@gmail.com)>
wrote:

Is it possible? :slight_smile:

My problem is that I have a report handler that posts stats to stathat.com (http://stathat.com),
and the gem is incompatible with ruby 1.8 (or so I figured).

All my systems have 1.9.3 installed via RVM, and I want to use that for the
handler. The gem installs ok using fnichol’s rvm cookbook’s gem_package
recipe, but the handler still tries to run on the system Ruby (or the
omnibus Ruby, maybe?) [0].

Any clues?

Thanks!

  • cassiano

[0] https://gist.github.com/cassianoleal/5090866