gem_package with local gem file barfs


#1

Hello,

I have a locally patched version of ohai (for OHAI-235) and versioned
it 0.5.9. This gem installs fine manually. Now I try to install this
gem with a gem_package resource as follows:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
notifies :restart, "service[chef-client]"
end

However, I get a stacktrace from withing rubygems:

When adding the gem_binary option to the resource, it works like a charm:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
gem_binary “gem” #Needed to use a gem command line client
notifies :restart, "service[chef-client]"
end

Bug?

Ringo


#2

On Wednesday, February 9, 2011 at 6:36 AM, Ringo De Smet wrote:
Hello,

I have a locally patched version of ohai (for OHAI-235) and versioned
it 0.5.9. This gem installs fine manually. Now I try to install this
gem with a gem_package resource as follows:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
notifies :restart, "service[chef-client]"
end

However, I get a stacktrace from withing rubygems:

https://gist.github.com/818558

When adding the gem_binary option to the resource, it works like a charm:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
gem_binary “gem” #Needed to use a gem command line client
notifies :restart, "service[chef-client]"
end

Bug?
Definitely. What version of rubygems?

Dan DeLeo


#3

Dan,

On 10 February 2011 07:05, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, February 9, 2011 at 6:36 AM, Ringo De Smet wrote:

When adding the gem_binary option to the resource, it works like a charm:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
gem_binary “gem” #Needed to use a gem command line client
notifies :restart, "service[chef-client]"
end

Bug?

Definitely. What version of rubygems?

This is on rubygems 1.4.2. This is the version that came with the
Vagrant lucid64 base box, so you can easily reproduce it that way.

Ringo


#4

Dan,

On 10 February 2011 07:05, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, February 9, 2011 at 6:36 AM, Ringo De Smet wrote:

When adding the gem_binary option to the resource, it works like a charm:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
gem_binary “gem” #Needed to use a gem command line client
notifies :restart, "service[chef-client]"
end

When using the gem_binary option, the gem seems to be installed at
every Chef client run. Since I signal the client to restart after
installing the gem, it is continuously restarting itself:

Not good…

Ringo


#5

On Thursday, February 10, 2011 at 1:15 AM, Ringo De Smet wrote:
Dan,

On 10 February 2011 07:05, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, February 9, 2011 at 6:36 AM, Ringo De Smet wrote:

When adding the gem_binary option to the resource, it works like a charm:

gem_package “#{Chef::Config[‘file_cache_path’]}/#{ohaiGem}” do
action :install
version ohaiGemVersion
gem_binary “gem” #Needed to use a gem command line client
notifies :restart, "service[chef-client]"
end

When using the gem_binary option, the gem seems to be installed at
every Chef client run. Since I signal the client to restart after
installing the gem, it is continuously restarting itself:

https://gist.github.com/820181

Not good…

Ringo
Ringo,
Can you try upgrading rubygems to 1.5.x and see if your problems persist? 1.4.x was out for only a short while before being superseded by 1.5.x.


Dan DeLeo


#6

Dan,

On 10 February 2011 16:52, Daniel DeLeo dan@kallistec.com wrote:

Ringo,
Can you try upgrading rubygems to 1.5.x and see if your problems persist?
1.4.x was out for only a short while before being superseded by 1.5.x.

Same thing with RubyGems 1.5.2.

Ringo


#7

Same thing with 1.3.7, for that matter. I ran into this yesterday,
and opened a ticket:

http://tickets.opscode.com/browse/CHEF-2041

On Friday, February 11, 2011, Ringo De Smet ringo.desmet@gmail.com wrote:

Dan,

On 10 February 2011 16:52, Daniel DeLeo dan@kallistec.com wrote:

Ringo,
Can you try upgrading rubygems to 1.5.x and see if your problems persist?
1.4.x was out for only a short while before being superseded by 1.5.x.

Same thing with RubyGems 1.5.2.

https://gist.github.com/822133

Ringo


Mark J. Reed markjreed@gmail.com