Hi there,
somehow my rubygems got cripled. The problem is ruby/irb is not able to
find/locate any of my previously installed gems. The problem is that
when I install some gem I am not able to use it (require could not
locate that gem). You can see bash output below. I tried to
remove/purge/autoremove/install ruby/rubygems/irb many times and still
it is not working. Thank you for any ideas provided in advance.
Platform:
korczis@korczis-nb:~/prog/smartdata/bin$ uname -a
Linux korczis-nb 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03
UTC 2010 i686 GNU/Linux
Let me show you that:
1) I will install nokogiri gem
korczis@korczis-nb:~/prog/smartdata/bin$ sudo gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.4.4
1 gem installed
Installing ri documentation for nokogiri-1.4.4...
No definition for get_options
No definition for set_options
No definition for parse_memory
No definition for parse_file
No definition for parse_with
Installing RDoc documentation for nokogiri-1.4.4...
No definition for get_options
No definition for set_options
No definition for parse_memory
No definition for parse_file
No definition for parse_with
korczis@korczis-nb:~/prog/smartdata/bin$
2) I will try to check it with irb (You will see that irb is not able to
locate previously installed gem)
orczis@korczis-nb:~/prog/smartdata/bin$ irb
irb(main):001:0> require 'nokogiri'
LoadError: no such file to load -- nokogiri
from (irb):1:in `require'
from (irb):1
irb(main):002:0>
3) I will list installed gems
korczis@korczis-nb:~/prog/smartdata/bin$ gem list
Hi there,
somehow my rubygems got cripled. The problem is ruby/irb is not able to
find/locate any of my previously installed gems.
2) I will try to check it with irb (You will see that irb is not able to
locate previously installed gem)
orczis@korczis-nb:~/prog/smartdata/bin$ irb
irb(main):001:0> require 'nokogiri'
LoadError: no such file to load -- nokogiri
OK, so what does
puts $:
tell you?
···
On Wed, Dec 22, 2010 at 3:03 PM, Tomas Korcak <korczis@gmail.com> wrote:
You need to 'require "rubygems"' in ruby 1.8. If your ~/.irbrc doesn't have that, you must do it explicitly when you fire up irb.
···
On Dec 22, 2010, at 15:03 , Tomas Korcak wrote:
2) I will try to check it with irb (You will see that irb is not able to
locate previously installed gem)
orczis@korczis-nb:~/prog/smartdata/bin$ irb
irb(main):001:0> require 'nokogiri'
LoadError: no such file to load -- nokogiri
Hi there,
somehow my rubygems got cripled. The problem is ruby/irb is not able to
find/locate any of my previously installed gems.
2) I will try to check it with irb (You will see that irb is not able to
locate previously installed gem)
orczis@korczis-nb:~/prog/smartdata/bin$ irb
irb(main):001:0> require 'nokogiri'
LoadError: no such file to load -- nokogiri
You need to 'require "rubygems"' in ruby 1.8. If your ~/.irbrc doesn't
have that, you must do it explicitly when you fire up irb.
Wow, amazing, it is working as the sharm.. Thank you for that point
Ryan.
Everybody excuse me please for that kind of silly question. That had to
be questioned many times before but I was not able to google for any
solution
Last quick question. How can I setup ~/.irbrc to do not need include
rubygems in every (irb instance)/(ruby file) manualy?
korczis@korczis-nb:~/prog/smartdata/bin$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'nokogiri'
=> true
irb(main):003:0> require 'png'
LoadError: no such file to load -- inline
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/png-1.2.0/lib/png.rb:5
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):3
irb(main):004:0> exit
korczis@korczis-nb:~/prog/smartdata/bin$
PS: There is still some problem with png library but that will be some
png lib issue (i think).
Thanks Everybody (especially Phillip, Hassan and Ryan) for incredibly
fast reply. Problem is solved now. It was sufficient to just include
ruby gems explicitly or to put "require 'rubygems'" line in ~/.irbrc
file.
PS: I am surprised in good way again how friendly ruby community is..
For some reason you have the png gem installed but not the RubyInline gem.
sudo gem install RubyInline
should fix that. There is no dependency on libpng.
···
On Dec 22, 2010, at 15:26 , Tomas Korcak wrote:
irb(main):003:0> require 'png'
LoadError: no such file to load -- inline
...
PS: There is still some problem with png library but that will be some
png lib issue (i think).
On Thu, Dec 23, 2010 at 12:14 AM, Tomas Korcak <korczis@gmail.com> wrote:
Am I right when I am thinking that it is looking for gems somewhere else
that it should be (/usr/local/lib/site_ruby/1.8)?
PS: Maybe I did installed ruby from sources in past and there is some
residue causing the problem at the moment.. I am not sure
--
Phillip Gawlowski
Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.