dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

robe integration with rbenv #109

Closed yilkalargaw closed 7 years ago

yilkalargaw commented 7 years ago

I can not get robe-start to work when using ruby under rbenv. It gives out the following error on inf-ruby console

from /home/userm/.emacs.d/elpa/robe-20170611.1755/lib/robe/sash/doc_for.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/userm/.emacs.d/elpa/robe-20170611.1755/lib/robe/sash.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/userm/.emacs.d/elpa/robe-20170611.1755/lib/robe.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from (irb):2
    from /usr/bin/irb:11:in `<main>'

since there are many of us using rbenv to manage ruby versions It would also be good to have a good documentation on how to integrate the two.

dgutov commented 7 years ago
  1. Put rbenv configuration into ~/.profile.
  2. Re-login.

Job done!

yilkalargaw commented 7 years ago

rbenv configuration is my .profile and .bashrc I do not think that is it

To clarify the error it starts when I run robe-start it asks if it could open a console and when I say yes it gives out

No matching directory found rbenv using 2.3.3

if I open inf-ruby manually it will give out the error mentioned above in the infruby buffer and links it to the require pry and and the code below

`` if Gem::Specification.unresolved_deps.empty? then RUBYGEMS_ACTIVATION_MONITOR.exit return gem_original_require(path) end

``

this didn't happen when I used to use rvm

dgutov commented 7 years ago

MacOS?

dgutov commented 7 years ago

When you visit a file inside your project, press M-! and type ruby --version there. What does it show?

yilkalargaw commented 7 years ago

I use ubuntu 16.04 the ruby --version from within emacs gives command gives ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

the ruby --version from within the shell ruby 2.4.0 ruby global 2.4.0

yilkalargaw commented 7 years ago

tanks very much solved the issue the eval "$(rbenv init -)" was missing in the .profile but not in the .bashrc for the other issues I used the package "rbenv" in MELPA it' old but it did the trick. I managed to send infruby the right version of ruby for each project. thanks very much.

dgutov commented 7 years ago

I'm glad you have it solved. And to be clear, with properly set up .profile, you don't need rbenv.el, at all.