Installing a gem (rvm_gem) from a private gem repository with Chef?

388 views Asked by At

I am actually having an issue while trying to write a configuration in Chef.

I have wrote a gem on my own, and pushed it to a private repository using Gem In A Box.

My recipe installs RVM and ruby successfully, but fails when tries to install the gem from the repository.

Below is the code :

rvm_gem "es_backup_s3" do
  version     "0.3.0"
  source      "http://[private_repository]:9292/gems/es_backup_s3-0.3.0.gem"
  action      :install
end

I was wondering what was the reason of the failure.

Is there a generic answer for my issue? Or should I download the gem first in the machine then trying an install from a local file?

Thanks!

[Bruno]

1

There are 1 answers

4
abc123 On BEST ANSWER

Have you tried using the higher level chef commands?

gem_package 'es_backup_s3' do
    version '0.3.0'
    source 'http://[private_repository]:9292/gems/es_backup_s3-0.3.0.gem'
    action :install
end

This should work just fine, and allow for support for more platforms (if the gem supports them)