Installing Nokogiri


#1

Here is what I am trying.

rbenv_gem “nokogiri” do
ruby_version "1.9.3-p545"
options "-- --use-system-libraries"
end

Was getting an error telling me that Options expects a hash.

I’m not sure how to put “-- --use-system-libraries” in the form of a hash?
I’ve tried all sorts of syntax changes, but I am having no luck.

Anyone?


#2

I used the “gem_package” resource…

    gem_package nokogiri do
      options "-- --use-system-libraries"
      action :install
    end


Kevin Duane
Senior Systems Engineer
The Walt Disney Company
• 818.549.5304 | Tieline 8250.5304 | G-Voice 323.207.6292

On 7/9/14, 11:23 AM, “Kenneth Barry” <kbarry-x@tunein.commailto:kbarry-x@tunein.com> wrote:

Here is what I am trying.

rbenv_gem “nokogiri” do
ruby_version "1.9.3-p545"
options "-- --use-system-libraries"
end

Was getting an error telling me that Options expects a hash.

I’m not sure how to put “-- --use-system-libraries” in the form of a hash?
I’ve tried all sorts of syntax changes, but I am having no luck.

Anyone?


#3

what version of chef you are using, rbenv_gem should accept both string or
hash[1],
also looking at the code trail (2,3,4) , may be you can pass :build_args =>
[’-- --use-system-libraries’] , but i have not tried this,

ranjib

[1]https://github.com/fnichol/chef-rbenv/blob/master/resources/gem.rb#L29
[2]
https://github.com/opscode/chef/blob/master/lib/chef/provider/package/rubygems.rb#L201
[3]
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/dependency_installer.rb#L27
[4]
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/installer.rb#L112

On Wed, Jul 9, 2014 at 10:08 PM, Duane, Kevin Kevin.Duane@disney.com
wrote:

I used the “gem_package” resource…

    gem_package nokogiri do
      options "-- --use-system-libraries"
      action :install
    end

Kevin Duane

Senior Systems Engineer

The Walt Disney Company

( 818.549.5304 | Tieline 8250.5304 | G-Voice 323.207.6292

On 7/9/14, 11:23 AM, “Kenneth Barry” kbarry-x@tunein.com wrote:

Here is what I am trying.

rbenv_gem “nokogiri” do
ruby_version "1.9.3-p545"
options "-- --use-system-libraries"
end

Was getting an error telling me that Options expects a hash.

I’m not sure how to put “-- --use-system-libraries” in the form of a hash?
I’ve tried all sorts of syntax changes, but I am having no luck.

Anyone?


#4

I ended up modifying the resource to accept both hash and strings. That
made it work :slight_smile:

On Wed, Jul 9, 2014 at 10:38 PM, Ranjib Dey dey.ranjib@gmail.com wrote:

what version of chef you are using, rbenv_gem should accept both string or
hash[1],
also looking at the code trail (2,3,4) , may be you can pass :build_args
=> [’-- --use-system-libraries’] , but i have not tried this,

ranjib

[1]https://github.com/fnichol/chef-rbenv/blob/master/resources/gem.rb#L29
[2]
https://github.com/opscode/chef/blob/master/lib/chef/provider/package/rubygems.rb#L201
[3]
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/dependency_installer.rb#L27
[4]
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/installer.rb#L112

On Wed, Jul 9, 2014 at 10:08 PM, Duane, Kevin Kevin.Duane@disney.com
wrote:

I used the “gem_package” resource…

    gem_package nokogiri do
      options "-- --use-system-libraries"
      action :install
    end

Kevin Duane

Senior Systems Engineer

The Walt Disney Company

( 818.549.5304 | Tieline 8250.5304 | G-Voice 323.207.6292

On 7/9/14, 11:23 AM, “Kenneth Barry” kbarry-x@tunein.com wrote:

Here is what I am trying.

rbenv_gem “nokogiri” do
ruby_version "1.9.3-p545"
options "-- --use-system-libraries"
end

Was getting an error telling me that Options expects a hash.

I’m not sure how to put “-- --use-system-libraries” in the form of a hash?
I’ve tried all sorts of syntax changes, but I am having no luck.

Anyone?