Question

I have an app that I run in three different environments, so sometimes when I pull it from github, I'll get the default rails "Oops, there was a problem with the server" page instead of the stack trace page. This seems to only happen when there's a problem related to a gem.

I remember maybe 6 months or a year ago when developing, if I had a missing gem, it'd show me the no such file to load -- mysql stack trace page.

This is mostly out of curiosity, but this actually does slow me down a bit as I have to tail the log to find what's broke on me.

Was it helpful?

Solution

You should add your gems in your environment.rb file.

For example if your application requires redcloth, you add in the environment file (the global one or any environment specific one).

config.gem 'RedCloth',
         :lib => 'redcloth',
         :version => '>= 4.2.2'

Your application won't load until you install that gem. And it'll display you a message asking you to install it.

You'll find more informations here.

OTHER TIPS

Which server are you using to run your app?

Passenger runs in production mode unless explicitly told otherwise in the passenger configuration.

Any chance either of these lines appear uncommented in config/environemnt.rb?

ENV['RAILS_ENV'] ||= 'production' 
ENV['RAILS_ENV'] = 'production'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top