Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gem "better_errors" not working - Rails 3.2

I'd like to use the gem "better_errors" with my rails 3.2 application, but it's still the default error page who's displayed.

In my Gemfile :

group :development do
  gem 'quiet_assets', '>= 1.0.1'
  gem 'better_errors', '>= 0.3.2'
  gem 'binding_of_caller', '>= 0.6.8'
end

I did a "bundle install" and then

bundle show better_errors
/usr/local/lib/ruby/gems/1.9.1/gems/better_errors-0.5.0

Everything seems to be well configured.

I run my rails server in development environment

rails s -e development

Any ideas? Thanks a lot.

like image 561
Gozup Avatar asked Feb 20 '13 09:02

Gozup


4 Answers

I scratched my head for days with the same problem. I finally e-mailed Charlie and he replied an hour or so later with my answer: "You need to be on localhost to use better_errors"

I had been developing in a Ubuntu VM on a Windows 7 host and browsing the site from Windows. Although it's a security risk, you can allow this by following the instructions here: https://github.com/charliesome/better_errors#security

I hope this resolves your issue.

like image 58
Jeffrey LeCours Avatar answered Nov 13 '22 21:11

Jeffrey LeCours


add line to ./config/environments/development.rb

BetterErrors::Middleware.allow_ip! "CLIENT_IPADDR"

and, restart rails-server

like image 28
tech.jin Avatar answered Nov 13 '22 21:11

tech.jin


You can follow this episode of railscast:

http://railscasts.com/episodes/402-better-errors-railspanel

This is my group development with better_errors gem:

group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'meta_request'
end

You can follow these steps:

Update better_error gem to the last version!.

1º uninstall current version of better_error gem with command gem uninstall better_errors.

2º Then Remove '>= 1.0.1', '>= 0.3.2', '>= 0.6.8' of your gem file and run the command bundle install

Regards!

like image 1
hyperrjas Avatar answered Nov 13 '22 23:11

hyperrjas


Can you try a bundle update? as the current version I have is 0.6.0.

Also I don't use the config/initializers/better_errors.rb file

Check in the server logs if you are not having 500 Internal Server Errors, when I've got them at the models after an ajax update I don't see the better_errors page.

like image 1
Paulo Fidalgo Avatar answered Nov 13 '22 21:11

Paulo Fidalgo