janlelis/irbtools

Couldn't load the irb library 'hirb' / 'ap': LoadError

Closed this issue · 9 comments

So, today I was learning a bit more about bundler, and I tried bundle clean, thinking that it would show me the gems before removing them, and before I hit Ctrl+C to cancel, it removed a few gems.

Now, when I open irb, which requires irbtools:

$ irb                       
Welcome to IRB. You are using ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]. Have fun ;)
>> Couldn't load the irb library 'hirb': LoadError
* cannot load such file -- hirb
* /home/[user]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'

Couldn't load the irb library 'ap': LoadError
* cannot load such file -- crack/xml
* /home/[user]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

I reinstalled hirb and awesome_print, but the error still occurs.

$ gem list | grep hirb
hirb (0.7.0, 0.6.2, 0.5.0)

$ gem list | grep awesome_print
awesome_print (1.1.0, 1.0.2, 0.4.0)

I also tried reinstalling irbtools. Looks like I broke something. :/ I don't want to stop using irbtools, since I like it a lot. Can someone tell me what I could try to fix this?

Hi js-coder, sorry for the late answer. Do you still experience these problems? Did you try to reinstall all hirb versions? Does irbtools work properly outside of bundled environments?

Do you still experience these problems?

Yep.

Did you try to reinstall all hirb versions?

I'm not sure, how would I do that?

Does irbtools work properly outside of bundled environments?

Nope, I get the exact same output when requiring irbtools.

Did you try to reinstall all hirb versions?

I'm not sure, how would I do that?

When doing gem uninstall hirb, it'll ask you, if you want to remove all hirb versions.

On the other hand, does it work in a bundled environment (without the anti bundler hack in your irbrc)?

Yeah, I removed all hirb versions, but I didn't reinstall all of those, just the newest one. That sounds like it might be causing a problem, but how do I found out what versions I need?
I didn't write down which versions I removed.

On the other hand, does it work in a bundled environment (without the anti bundler hack in your irbrc)?

Sorry for all the questions, but what anti bundler hack?

Sorry for not explaining: Since some weeks, the readme explains how to run irbtools in bundler environments without having to put it in the Gemfile (https://github.com/janlelis/irbtools/#rails-notes). I just want ensure that you are not using it to except it as a source for the problem.

Can please also you check if ruby -S gem list hirb outputs the same hirb versions as gem list hirb does?

Putting that hack into my ~/.irbrc didn't help, I don't get any error but it doesn't seem to load irbtools, $ irb just starts the plain old irb.

Can please also you check if ruby -S gem list hirb outputs the same hirb versions as gem list hirb does?

Yep, it does.

OK, please remove the bundler hack from your ~/.irbrc again.

Which OS do you use? Are you using RVM to manage rubies? If so, dose the error also show up in another Ruby version?

Ubuntu 12.04, RVM and Ruby 1.9.3.

Since irbtools doesn't work on 1.8.7 I installed Ruby 1.9.2, so I didn't have any gems installed there and installed irbtools on 1.9.2. It works perfectly. :)
Do you have any idea how I could get it to work on 1.9.3 again though, other than removing all my gems?

Today I had a similiar problem with rspec and I've decided to remove all gems from 1.9.3 and reinstall again what I need. irbtools works perfectly now. :)

Thanks for your help and irbtools!