Question

My recipe

include_recipe 'mysql::server'

and mysql::server call

chef_gem 'mysql'

chef_gem 'mysql' use like gem source http://rubygems.org/

I need use my own gems local server.

How can I change the gem source for all chef running?

OPTION: I try install at first mysql gem with

chef_gem 'mysql' do
  options "--source http://my.own.local.server/"
  version "2.9.1"
end

but don't work.

Any body have other idea?

Was it helpful?

Solution

There're severals things out of your question:

Use the chef_gem resource to install gems into the instance of Ruby that is dedicated to the chef-client. Use the gem_package resource to install all other gems (i.e. install gems system-wide).

  • install gem (and its dependencies) from other source than http://rubygems.org/

For example:

gem_package "mysql" do
  options("--clear-sources --source http://my.own.local.server/")
  action :install
  version "2.9.1"
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top