All threads / Debugging With BetterErrors Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Debugging With BetterErrors Discussion

Richard Nyström ·

Thanks! This will help me a lot.

Reply

i use pry. how is this better?

Pry is awesome as well. This is similar and doesn't need to be in your console. It's not as powerful as pry in some areas like being able to cd into objects, so you can use the two together.

Reply

Hi Chris,

I'm running into an issue when installing binding_of_caller. When I run bundle install I get the following error An error occurred while installing debug_inspector (0.0.2), and Bundler cannot continue. Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before bundling. I'm not sure how to get around this. Any ideas?

Interesting. I haven't had trouble with that gem before. Did it give you any more text for the error?

Thanks for the reply. Here's the total output:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

creating Makefile

make "DESTDIR="

compiling debug_inspector.c

linking shared-object debug_inspector.bundle

clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

make: *** [debug_inspector.bundle] Error 1

Gem files will remain installed in /Users/ryan.dagostino/.bundler/tmp/17652/gems/debug_inspector-0.0.2 for inspection.

Results logged to /Users/ryan.dagostino/.bundler/tmp/17652/gems/debug_inspector-0.0.2/ext/debug_inspector/gem_make.out

An error occurred while installing debug_inspector (0.0.2), and Bundler cannot

continue.

Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before

bundling.

That sounds like your compiler is too old maybe. I'm not sure the best solution there. What version of your OS are you on and what version of Ruby are you using?

Hopefully it's not my computer running OS X 10.9 and Ruby version 2.0.0p247. You think it just needs an upgrade to the Ruby version?

I think it has something to do with the compiler on that version of OSX and/or Ruby. I just found a post on Stack Overflow that might be of help. Here are a bunch of suggestions on how to fix it: http://stackoverflow.com/qu...

Thanks for the help Chris. Regardless better errors is working. Great tutorial by the way.

Thanks everything worked after I updated my Ruby version.

Reply

cool! I had been using `binding.pry` in my controllers to debug like this but it's definitely faster if I don't have to add and remove that line every time. thanks!

Reply

Super useful. Thank you, Chris!

Reply
Jordano Moscoso ·

I don't know how i lived my days without this. Thanks.

Reply

When Rails 5 came out Better Errors was incompatible. Not sure if works with Rails 5 now. But anyway I began using the web-console gem in the development environment instead and it's actually better. It provides the same IRB console when you get an error but you can also insert the console anywhere in your app by adding 'console' in the controller action or <%= console %> in the view. And you don't need to also install binding_of_caller.

Reply

Hi Chris!

After watching this video, I remember the conversation we had that I was referring to.

We were discussing debugging. You mentioned that maybe this gem has been updated, or is now a part of rails, or something...

I'd like to use this but before trying to install, wanted to see if you remembered what it was we were discussing. Does this ring a bell?

-Monroe

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,885+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.