shuky19 / sublime_debugger

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

Rails 4 support #7

Closed shuky19 closed 10 years ago

shuky19 commented 10 years ago

For now support for rails 4 is done only by using StartDebug command and wrting 'bin/rails s'.

It should be supported built in.

Rameshv commented 10 years ago

Hi Shuky19 could you please elaborate more on this, when i tried start debug rails (4) app, i am always getting this error

Last exception: #<NameError: uninitialized constant ApplicationController>
shuky19 commented 10 years ago

Hi @Rameshv,

There is not enough details, but "Last Exception" logs are written from at_exit hook i use. It's mainly says that this exception happens from your application and not from the debugger.

Look at the ruby version the debugger is using (on the output window) I guess you do not have rails installed on that ruby version it uses.

Moreover, I hope to find a way for better integration with rvm and linux shell, they are doing a lots of troubles.

Bests,

Shuky

Rameshv commented 10 years ago

Hi @shuky19 , thanks for the reply. The application is a live one and i am successfully debugging it in rubymine for long. Is there any log file should i check for sublime debugger. that way we can pin point the exact problem.

Thanks

shuky19 commented 10 years ago

For now the only logging place is the output file. Can you tell me exactly what you did?

Shuky.

Rameshv commented 10 years ago

Below the steps

  1. I opened the sublime from my shell (fish/tmux)
  2. opened the rails project in sublime
  3. clicked start rails debugging rails from tools -> debugger menu
  4. Got the error saying uninitialized constant ApplicationController

I observed one weird thing now, its not always uninitialized constant ApplicationController issue. It throws different uninitialized constant erros depending on the file. If i start the rails debugging from My uploader file it says uninitialized constant CarrierWave::Uploader::Base

I think rails debugger is not starting the rails debugger, instead it tries to debug the current file. Thats why we are getting uninitialized constants errors because its not in rails scope.

@shuky19 could you please give me the step by step guide how you have tried rails 4 debugging. May be i can try the same thing here and see if that works

shuky19 commented 10 years ago

Hi

Thank you for the detailed steps, I believe the problem is somehow the way RubyDebugger starts rails.

Can you please make sure the following works good:

First make sure you choose the right debugging option (Debug current file, Debug file, Debug rails) which is Debug rails (Shift+F6) and try activate it not from the menu (Command bar or keyboard shortcut)

Second, if last step didnt work, make sure the following command successfuly starts rails: '''ruby script/rails'''

Moreover I am now working on a few changes with rails support, so it will uses the bundler and make it work when you not starting sublime from the terminal.

Shuky.

shuky19 commented 10 years ago

Hi guys,

I just pushed new version and this bugs should be fixed, please let me know.

Shuky