.irbrc not executing after installing RBEnv

I just migrated from RVM to RBEnv (+ ruby-build). I have my own .irbrc file, but after installing rbenv it doesn't seem to execute it. This is on OS X Lion.

I updated .bash_profile with:

export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" 

not sure if this is necessary, but which irb shows:

 /Users/me/.rbenv/shims/irb 

also, echo $PATH give:

 /Users/me/.rbenv/shims:/Users/me/.rbenv/bin:/opt/local/bin/bundle:/opt/local/bin/ruby:/opt/local/bin:/opt/local/sbin::/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin 
  • I changed my username to “me,” in which the echo above

Thoughts? Thanks in advance!

+4
source share
1 answer

Well, I had the exact same problem, and it took me a while to figure it out, I thought I would share it, as people can land here.

The main problem with .irbrc is that it will fail, so it becomes less obvious for debugging. In my case, it turns out that the stone was not found and threw a LoadError exception that prevented the .irbrc evaluation.

a good first step is to comment out each line in your .irbrc and leave only something like

 puts "loading .irbrc all working fine so far" 

That way you at least know that this is loading. If he uncomments the source code and sprays it with some puts statements to determine where it stops loading.

The most likely reason is because some code throws some kind of exception that prevents it from loading. Hope this helps others.

+2
source

Source: https://habr.com/ru/post/1379594/


All Articles