
- 475
- 1
- 4
- 11
-
Possible duplicate of [set rails console stack backtrace limit permanently](http://stackoverflow.com/questions/26295935/set-rails-console-stack-backtrace-limit-permanently) – infused Oct 22 '16 at 03:22
1 Answers
You can use various Ruby gems, specifically the pry
gem which is used as a substitute for the console/irb. Pry has heaps of features, but for your specific question it functions to improve debugging.
For example, the below image shows an error in just one line that references the file and line of the error, as well as providing a short snippet of the error, rather than a large wall of text:
To install pry, require it in your Gemfile using the line:
gem 'pry'
then install it by running the following after changing directory (cd some/directory/app
) into your app:
gem install pry
As a side note, there is also the great better_errors
gem. This isn't used in the terminal, but is used in your browser when an error gets displayed.
The image below shows what the in browser error rendering looks like. IMO, much cleaner than the standard red/white UI. Also you can use its interactive console within the browser and heaps more

- 4,161
- 7
- 39
- 50