Rails Web Console and development error not showing up - ruby-on-rails

I recently updated my rails application to rails 5.2 and Ruby Version 2.3.3 to my surprise, a development error in the browser is not showing up as error anymore but with the message
We are sorry, something went wrong
If you are the application owner please check logs
while,
config.consider_all_requests_local = true
is present in my development.rb file.
and running RAILS_ENV=development rails s too doesn't help
And all changes I made was by following the rails guide only.
A similar thread exists with no conclusion: here
Thanks in advance

I had the same issue too, when I checked in my config/environments/development.rb the config.consider_all_requests_local = true was set to false.
After that for web console debugging I install gem "better_errors" and everything works fine. Also make sure gem web-console is also installed.

I tried to update the 'web-console' gem and it works.

Related

Rails development env dont show the error type and console on error 500

My development errors look like in production.
Here how they are looking in development:
Production style errors
Instead of this error design :
Development style errors
I tried to consider all request as local in production.rb but this doesn't make them looking like they are supposed to look in development.
config.consider_all_requests_local = true
can someone help me to find out how to come back to the usual error development style? Thanks !
Make sure you are running your application in development mode,
use RAILS_ENV=development rails s
If that is not the issue check your Gemfile maybe you are using a gem for displaying errors and it is not under group :production
Thanks a lot for your help. After an analysis of all my commits I found out it was due to a bundle update of the Gemfile.lock

Dokku Rails application missing static assets with 404 error

I deployed a rails application with Dokku. Everything went fine except that all my assets including images returns a 404 error.
I really don't know how to debug this.
For dokku it is simple to add:
dokku config:set <your-app> RAILS_SERVE_STATIC_FILES=true
I had exact same issue and adding the following gem solved it:
gem 'rails_12factor', group: :production
That's the official way of dealing with that issue on Heroku for Rails 3 and 4 (and that gem is made by Heroku team as well).
On rails 5, try making the changes in production.rb that are suggested on this page rails_12f
Finally I just added this :
config.serve_static_files = true
in environements/production.rb
Note: flag deprecated in Rails 5.0 in in favor of config.public_file_server.enabled

production.log empty on Rails 4 / Capistrano / Passenger / Nginx server (digital ocean)

I have set up a rails 4 server on Ubuntu 12.04 using Capistrano, Nginx, Passenger, Postgres, Redis/Resque
Everything is working great, except that the production.log file is always empty.
I have tried a variety of configuration changes in production.rb to no avail.
It's definitely not a permissions issue, as the permissions on both the log dir and each of the logs are wide open (777)
Can anyone hep me figure out how to get basic logging working?
The culprit was Heroku's rails_12factor gem
Removing that gem from the Gemfile, now the logs are working as expected.
# group :production do
# gem 'rails_12factor'
# end
To clarify, the rails_12factor gem was responsible, but that's only because it includes rails_stdout_logging, which is the real culprit, however, due to it's intended behavior to "ensure that your logs will be sent to standard out."
Check with the log levels in production.rb file, config.log_level = :debug will display it's errors. Also make sure the server is running production mode, in case you have not made any changes any configuration files for rails env, production mode is by default.

Rails 4 and gem (will_paginate) not deploying correctly

I am working with Rails 4 and I am using this library for my pagination, but I have a problem when I deploy to production, I see this error:
/home/deployer/apps/app/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:in
require'/home/deployer/apps/app/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0.rc1/lib/active_support/dependencies.rb:228:inrequire':
No such file to load -- will_paginate/array (LoadError)
In development this library is working but in production I have this error, I was searching for this error on Google but I can't find a solution.
Do you have any idea what may be wrong? Let me know when you find out please.
Thanks for you help.
First things first, check that the will_paginate gem is enabled for production in your Gemfile. It may be under the :development group only.

First Heroku Push of Application to Heroku leads to Application Error

I am relatively new to Heroku and Rails. I have pushed a small "app" to Heroku before which worked fine.
Now I have developed a bit of a larger application on my desktop pc, which runs fine using my rails server as localhost.
When I try migrating it to Heroku I get the following message:
Application Error
=================
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
I started looking at the log files, but they don't really tell me anything. Can someone please give me a hint on how to interpret them. I think the last to logfile lines are the ones that crash the application:
2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
EDIT: I've now added the complete 'heroku logs' prompt output. Any suggestions on what to look for. I'm very unfamiliar with the log output, don't really know where to start.
EDIT 2: Thanks for all the help so far! I've got the app working now. The following was the problem
In my gem file I had ByCrypt linked in like this:
gem 'bcrypt-ruby', :require => 'bcrypt'
Since the Heroku logs said something about
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1.
I changed my Gemfile to
gem 'bcrypt-ruby', '~> 3.0.0'
This helped! The app is now running on heroku. But I think I now have a problem with the methods using bcrypt... but I will have to investigate this seperately. Thanks for the help!
have you migrated the database?
like this: heroku run rake db:migrate
if that dosn't work use this:
run heroku logs, and paste the log here
2013-08-12T17:54:56.944875+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem': can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all
dependencies are added to Gemfile. (Gem::LoadError)
maybe you forgot to add a gem explicity in your gemfile,

Resources