Nokogiri in Ruby on Rails apps (dev and production level)

32 views
Skip to first unread message

liugg

unread,
Jul 17, 2016, 12:10:58 PM7/17/16
to nokogiri-talk
I am in a Ubuntu 14.04 LTS machine and I installed Nokogiri in my global rvm gemset with 'gem install nokogiri'.
Nokogiri version is nokogiri-1.6.7.2.gem

According to the RailsApp project documentation, if Nokogiri is installed in the global gemset, it is also included in every new rails application.
So I suppose this would allow my application to use Nokogiri in the development environment without adding anything to my Gemfile.
What about my production environment?
I am deploying to Heroku: shall I take for granted that Heroku has Nokogiri installed in its servers or am I required to edit my Gemfile and add the new following line for Nokogiri?

gem 'nokogiri'

Hassan Schroeder

unread,
Jul 17, 2016, 1:52:38 PM7/17/16
to nokogi...@googlegroups.com
On Sun, Jul 17, 2016 at 1:53 AM, liugg <ml.ma...@gmail.com> wrote:

> I am deploying to Heroku: shall I take for granted that Heroku has Nokogiri
> installed in its servers or am I required to edit my Gemfile and add the new
> following line for Nokogiri?

What version of Rails are you using? Recent versions require (and
thus install) Nokogiri by default (take a look at your Gemfile.lock).

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

liugg

unread,
Jul 17, 2016, 3:04:07 PM7/17/16
to nokogiri-talk


On Sunday, July 17, 2016 at 7:52:38 PM UTC+2, hassan wrote:

What version of Rails are you using? Recent versions require (and
thus install) Nokogiri by default (take a look at your Gemfile.lock).


Rails version is '4.2.2'
My Gemfile.lock says:

nokogiri (1.6.7.2)
      mini_portile2 (~> 2.0.0.rc2)

Hassan Schroeder

unread,
Jul 17, 2016, 7:44:31 PM7/17/16
to nokogi...@googlegroups.com
On Sun, Jul 17, 2016 at 12:04 PM, liugg <ml.ma...@gmail.com> wrote:

> My Gemfile.lock says:
>
> nokogiri (1.6.7.2)

So does that not seem like it's taken care of? :-)

Of course, in much less than the time needed to ask the question
and wait for an answer you could have just tried it...

liugg

unread,
Jul 18, 2016, 6:48:16 AM7/18/16
to nokogiri-talk

So does that not seem like it's taken care of?   :-)

Of course, in much less than the time needed to ask the question
and wait for an answer you could have just tried it...

--
Hassan Schroeder

Many thanks Hassan.
Of course, with hindsight looking inside Gemfile.lock and answering myself seems a simple task. However I can assure you that before this post and your help I did not even consider the existence of Gemfile.lock and did not know its function, so I was blind. Only now that I consulted some documentation thanks your hint I can agree with you. It happens to me that problems suddenly arise like mountains and look not so steep and even ridiculous after being solved.

So I really appreciate your help and your directions, and apologize, if that matters.
Reply all
Reply to author
Forward
0 new messages