shuky19 / sublime_debugger

Interactive debugger for sublime
Apache License 2.0
429 stars 24 forks source link

Vanilla Installation Does Not Work in Sublime Text 3/OSX Yosemite #54

Open nomanurrehman opened 8 years ago

nomanurrehman commented 8 years ago

As per the configuration in the issue title, I am not able to make this work in said environment.

Here is the error I am getting(pasted as is):

Started process command: bash -c "'/Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/ruby_executor.sh' 'rvm' True  '-C/Volumes/Work/Ruby/stripe-ruby-mock' '-r/Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb' '-rbundler/setup'   '/Volumes/Work/Ruby/Snippets/testing_local_stripe_ruby_mock.rb' "
Connecting... 

----------------------------------------
------------Ruby Executor---------------
----------------------------------------
Method: RVM
Using ruby version: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin14.0]
Located at: /Users/noman/.rvm/rubies/ruby-2.1.0/bin/ruby
Ruby Arguments = -C/Volumes/Work/Ruby/stripe-ruby-mock -r/Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb -rbundler/setup /Volumes/Work/Ruby/Snippets/testing_local_stripe_ruby_mock.rb 

/Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb:14:in `block in <top (required)>': undefined method `wait_connection=' for Byebug:Module (NoMethodError)
    from /Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb:26:in `call'
    from /Users/noman/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb:26:in `<top (required)>'
    from /Users/noman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/noman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Debugger stopped
sasasasumna commented 8 years ago

I got this working locally by modifying sublime_debug_require.rb. I'm using rbenv and Ruby 2.3.0.

  1. Add require 'byebug/core' to the top of the file, which defines the Byebug.wait_connection= method
  2. Fix lines 13, 14 and 16 so a RubyVersion instance for your setup is properly defined.

I also had to change ruby_version_discoverer.rb to puts "2.3.0"

Fixing lines 13, 14, and 16 aren't really part of the issue here, but since I'm not using a supported version I had no choice. The whole RubyVersion system this uses probably needs to be redesigned so it attempts to require byebug then if that fails debugger, instead of hardcoding explicit version numbers and then expecting the proper gems to be installed.

kthxbye-bouyha commented 8 years ago

Can you gist your sublime_debug_require.rb please ?

nomanurrehman commented 8 years ago

@kthxbye-bouyha

https://gist.github.com/nomanurrehman/6652ba43343e12ec39a1

kthxbye-bouyha commented 8 years ago

tx ;-)