views:

89

answers:

2

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.

+1  A: 

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.

Damien MATHIEU
I'm doing this. Is that why I'm getting the 500.html message? Because the application isn't loading?
mculp
It wouldn't explain the 500.html message. Because if the gem wasn't configured script/server wouldn't even start.
EmFi
A: 

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'
EmFi
on my development boxes, I'm just doing script/server; on my will-be production box I'm using Passenger but have `RailsEnv development` set
mculp
Any chance either of these lines appear uncommented in config/environemnt.rb? `ENV['RAILS_ENV'] ||= 'production'` or `ENV['RAILS_ENV'] = 'production'`
EmFi
No, and after I fix the gem issue, if I have an error in my code I see the stack trace.
mculp