6

Has anyone had any luck using swapping irb out for pry in SublimeREPL? I'm close, I think. I don't get an error however I don't get a response when I enter a command either. It behaves like the buffer is being reset each time I hit return.


I'm using rbenv and have set my SublimeREPL PATH as follows:

  "default_extend_env": {"PATH": "{HOME}/.rbenv/bin:{HOME}/.rbenv/shims:{PATH}"}
Massimiliano
  • 16,770
  • 10
  • 69
  • 112
LeakyBucket
  • 160
  • 1
  • 11
  • 1
    So, the most excellent Wojciech Bederski has addressed the problem and pry is now the default Ruby REPL in Sublime. – LeakyBucket Dec 14 '12 at 18:47

3 Answers3

1

Try putting Pry.config.auto_indent = false to your .pryrc

horseyguy
  • 29,455
  • 20
  • 103
  • 145
  • Hmmm... it still behaves the same way. When I tell it to exit I see all my output but not until the REPL closes. I probably need to tweak some other settings. It could also be that the SublimeREPL PATH isn't set completely correctly. – LeakyBucket Jul 03 '12 at 03:56
0

Besides Setting PATH in default_extend_env, you have to set GEMPATH as well. Here is my SublimeREPL setting:

{
"default_extend_env": {
    "PATH": "{HOME}/.rbenv/shims:{PATH}",
    "GEM_PATH": "{HOME}/.rbenv/shims"}
}

You can add the following code at the beginning of pry_repl.py to print out the PATH to check if your setting is in effect.

puts "PATH:#{ENV['PATH']}"
puts "GEM_PATH:#{ENV['GEM_PATH']}"
dalang
  • 111
  • 6
0

I use RVM and Ruby 2.1.2. I changed /Users/[my name]/Library/Application Support/Sublime Text 3/Packages/User/SublimeREPL.sublime-settings to:

default_extend_env":
{
  "PATH": "/usr/local/bin/:{PATH}",
  "GEM_PATH": "{HOME}/.rvm/gems/ruby-2.1.2/"
}

To get your GEM_PATH, type gem env and get path from "INSTALLATION DIRECTORY:" or go into pry and type ENV['GEM_PATH']

Raymond Gan
  • 4,612
  • 3
  • 24
  • 19