#402 Better Errors & RailsPanel
Here we take a look at two tools to aid us in development: Better Errors which makes it easier than ever to debug exceptions, and RailsPanel, a Chrome extension to see Rails requests.
- Download:
- source code
- mp4
- m4v
- webm
- ogv
I love RailsPanel, however recently I discovered that it interacted poorly with rack-raw-upload, so I had to stop using it :( It's on my todo list to generate an isolated test case and report it, but I'm curious - has anybody else run across similar issues?
+1
For GNU Emacs users:
and install this: https://github.com/typester/emacs-handler
Great!
Awesome!
Really awesome but both rails_panel and better errors only support mac for editor integration? Sad, have linux users really become so rare that nobody cares?
Same here. I think that Linux-users are far more likely to tinker on their own. I found a solution (through my friends at google ;) ) which might be a solution, at least for Ubuntu: http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu
I'll give it a try, maybe lauchning gVim for that. YMMV, of course.
Gnome-only solution.
Too many mac-specific stuff everywhere in the Ruby world. Sad. But in this specific case it is the Chrome fault. It is actually unable to launch external editor in Linux.
Got it working in ruby with ubuntu using gedit as my editor and chrome as browser. I will post the link as soon as I get it up on github.
Okay I've posted the link for gedit and chrome here https://github.com/johnvross/gedit_better_errors/blob/master/README.md
It is not working for me. I used both FireFox and Chrome, and I click on "Launch App", but nothing happens
A little work to be happy with Linux- https://github.com/Dariusz-Choinski/better_errors_linux_kde_vim
The link you posted got me partway there, but I rewrote the cvim file so that it works for both better_error and RailsPanel.
https://gist.github.com/4699980
Try Sympathy editor, maybe it will work: https://github.com/captn3m0/sympathy
If you're a
pry
user, you can runbinding.pry
in the better_errors console and it will pop up in yourrails server
How? It launches an external console, not better_errors. Also binding.pry only set up a breakpoint at the specific place.
I use both pry, but since I switched to pow, it's become a pain. I started using better_errors and now when I'm doing something in the browser where I'd normally use pry, I just throw and use the binding it give you. Far easier. I still use pry for tests and such.
Just my .02.
Thanks, I couldn't get the handler to open sublime, this should work for now
Hi, thank's for this great episode!
Any clue how to configure the external handler for Rubymine? Have been trying for a couple of hours without success...
Others are trying to solve it too:
http://devnet.jetbrains.com/message/5477503?tstart=0
I would think you resolved it long ago so this is more for anyone else viewing this part of the thread. I improved the RubyMine section out on the Wiki
Unfortunately, Ruby 2.0.0-rc1 does not work with binding_of_caller :(
Neither does JRuby. bummer.
It's already fixed. binding_of_caller works with Ruby 2.0.0p0
Just a note for anyone that gets this error:
Make sure you put "binding_of_caller" AFTER "better_errors" if you want to use the editor= feature. It's been working fine for months without the initializer.
Great railscast! Great gems! Thank you so much.
I tried it right away. It doesn't work with ruby-1.8.*
Looking forward to using it in ruby-1.9.* projects.
Great episode Ryan, thanks. Knowing about /__better_errors eases Ajax requests debugging !
I made a bookmarklet to switch to the current app's /__better_errors page from your toolbar : https://github.com/czj/better_errors_bookmarklet
To use BetterError's file opening protocol links (subl://) with Sublime you will need https://github.com/asuth/subl-handler
Thanks Ryan for pointing at such an amazing tool!
It even points at the right line!
I can't get subl-handler to open, I get "SublHandler quite unexpectedly." On OS 10.7.5.
I got it to work on 10.8.2 with no problems. You should try submitting an issue to their page. Good luck!
UPD: Did you follow their instructions?
> Unzip it, then launch it. Select SublHandler -> Preferences..., then set the path for the subl binary.
You might probably need to first do this http://www.sublimetext.com/docs/2/osx_command_line.html
I've got the same issue.
I've successfully built it for Lion with Xcode. I just needed to replace the Deployment Target from 10.8 to 10.7
Here is the link:
https://dl.dropbox.com/u/9189157/SublHandler.zip
Hi, I have configured everything as the ryan suggested, and better errors already creates a link such as this one:
subl://open?url=file://%2Fusr%2Flocal%2Frvm%2Fgems%2Fruby-1.9.3-p362%2Fgems%2Factionpack-3.2.11%2Flib%2Fabstract_controller%2Fbase.rb&line=116
But sublime text 2 ignores that link on Google Chrome with Windows 7. Can someone help? That subl-handler seems to be Mac OS realated only. What about people running Sublime Text 2 on Windows?
Thanks
I am having a problem with the meta_request gem with dragonfly. When I upload an image I get a "closed stream" error. The upload completes though.
Better_errors looks great, but after installing my application would intermittently crash while running my rspec/capybara tests. After removing the gem, things went back to normal. Just a word of warning for others (using rails 3.2.8... yes, yes, I'm about to patch).
meta_request just immediately blows up with stack too deep errors for me, but I don't get any kind of stack request at all to try to understand where it's happening. :/
Nice video like the gems i just got some problem. I can't find how to setup urlhandler for sublime text 2 on linux.
hey guys. I spent some time rooting around and it's possible to do the same on linux...but it's not elegant.
Here's a post I wrote on how to do it. Or, at least it will point you in the right direction.
Nice Episode.. Thanks :) Is it possible to open in Netbeans?
BTW it will be nice to mention that better_errors works only with Rails >= 3.x
Unfortunately we cannot use this gem the ip is remote but on lan configuration.
I use a virtualbox for rails server and found out that the 192.168 ranged ip's are not counted as trusted request.
This is discussed in the project's github issues, where a user even posts a link to a workaround until this discussion settles on a solution.
For Better Errors, Sublime Text 2 and Ubuntu see https://gist.github.com/wojtha/4749450
thanks a lot! (works with FireFox and Chrome)
Does this work for you on Chromium on Ubuntu, too?
I got the script running by changing
sublime
tosubl
since the command is not available on my machine. I added a comment to the Gist. Thanks to Vojtěch Kusý.meta_request appears to conflict with exception_notification as featured in a previous episode. I'm running 1.8.7 so am unable to use better_errors.
I'm getting this:
uninitialized constant ActionDispatch::ExceptionWrapper
meta_request (0.2.1) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
Does anyone know why?
Wow .. Better Errors is excellent ... Love it
Also couldnt figure out how to open errors in sublime.
I'm using Ubuntu 12.04
:-/
I got the link to Sublime working for Windows 7. Here are the instructions: https://gist.github.com/Vaselinessa/5584662
It's as simple as creating a registry key and creating a batch file.
I'm having trouble with binding of caller. I can't start the rails server (or guard) with it installed. Any ideas on what to do about this error?
dyld: lazy symbol binding failed: Symbol not found: _RUBY_FREE_ENTER
Referenced from: .../.rvm/gems/ruby-1.9.3-p429/gems/binding_of_caller-0.7.1/lib/binding_of_caller.bundle
Expected in: flat namespace
dyld: Symbol not found: _RUBY_FREE_ENTER
Referenced from: .../.rvm/gems/ruby-1.9.3-p429/gems/binding_of_caller-0.7.1/lib/binding_of_caller.bundle
Expected in: flat namespace
Trace/BPT trap
Anyone having trouble when using better_errors with Puma, where when an exception is thrown or error occur we don't get any information back from server response?
Just want to say how great this addition has been to a project! I am doing alot of work with a SOAP API and when things go wrong the "live shell" has been awesome.
It seems for some people
subl-handler
doesn’t work as expected. Here’s my two cents: https://github.com/exalted/sublimetext-launcherFor Sublime Text 3 use this protocol handler: https://github.com/saetia/sublime-url-protocol-mac
Thanks this worked for me
Thanks Tim! This worked for me as well!!
This worked with sublime text 2 as well without any modification on Maverick and is the only one only one that actually worked, great application!
I am new to rails and i find these gems VERY VERY useful, thanks a lot!!!!
Awesome gem! I'm a new Rails user and always thought that the error output was ugly and not at all very helpful. Thanks a bunch!
Oh man, I got so pumped watching his but can't get it to work. Install the gemfile under development
group :development do
gem 'better_errors'
gem 'binding_of_caller'
end
bundle install
bundle update
fire up my app, get to an error, and just the same usual error screen as always.
Running Rails 4 on Ubuntu with Sublime Text 3. Any ideas?
I saw that this is mainly a Mac gemfile but thought that was just for the linking between the error screen and the text editor...
sad.
haha, didn't restart the server
happy! but feeling slightly stupid