nonsequitur / inf-ruby

218 stars 69 forks source link

inf-ruby-console-auto not loading pry #104

Closed choallin closed 7 years ago

choallin commented 7 years ago

I'm totally new to Emacs, but I want to switch to it for Ruby development. Right now I have a problem to load the right Ruby version for pry

I'm using rbenv to manage Ruby versions. If I want to start the auto console I get this error:

The `pry' command exists in these Ruby versions: 2.3.1 2.3.3 2.4.1 Process pry exited abnormally with code 127

I configured rbenv in my init.el like this:

(global-rbenv-mode) (rbenv-use-global)

Did I miss something?

dgutov commented 7 years ago

Does the project use the global rbenv version?

dgutov commented 7 years ago

And its Gemfile includes pry?

dgutov commented 7 years ago

Are you on macOS? What if you M-x rbenv-use-corresponding first?

choallin commented 7 years ago

In the project I have a .ruby-version file (content: 2.3.1) This is not the default ruby version.

I have pry in my Gemfile (in the development group) inf-ruby tries to start pry.

I run Ubunut 16.04. If I run the rbenv command it is working. Thanks! :-) Since I am totally new to Emacs, how can I configure emacs to run this command before the console command?

dgutov commented 7 years ago

If you're using Ubuntu, I recommend putting the rbenv settings into ~/.profile, removing them from ~/.bashrc where you've probably put them, rebooting (or you can try just logging off and loggin in), and removing the rbenv Emacs package and its settings. You won't need it. :)

dgutov commented 7 years ago

@choallin Any difficulties doing that?

choallin commented 7 years ago

@dgutov Thanks! No problems

dgutov commented 7 years ago

Great!