Pry in SublimeREPL
Asked Answered
I

3

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}"}
Isoagglutinin answered 1/7, 2012 at 4:39 Comment(1)
So, the most excellent Wojciech Bederski has addressed the problem and pry is now the default Ruby REPL in Sublime.Isoagglutinin
A
1

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

Alexis answered 2/7, 2012 at 2:4 Comment(1)
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.Isoagglutinin
C
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']}"
Carillonneur answered 16/7, 2013 at 14:48 Comment(0)
L
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']

Lancashire answered 30/6, 2015 at 16:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.