Just to clarify: only one site is broken; the other one is running
just fine. Also the broken site doesn't let me log connect with
`heroku console` (something about not having a free dyno available).
`heroku restart` didn't fix this, and I *know* that nobody is visiting
the site.

On Feb 18, 6:37 pm, Raving Genius <[email protected]> wrote:
> I have two websites running the same version of a CMS I'm working on,
> and each site has a small number of minor customizations. The CMS is
> built on top of Rails 3 and MongoMapper. I am getting an error every
> time I run a (any?) rake command which depends on :environment. The
> stack trace (and `heroku logs`) points me to config/initializers/
> mongo.rb (contents shown below). I have been using this config
> unaltered for quite a while without issue.
>
> As best as I can tell, the problem lies with ENV['MONGOHQ_URL']. Has
> ENV['MONGOHQ_URL'] somehow gotten mis-configured? Do I need to remove
> MongoHQ configuration and add it back?
>
> # config/initializers/mongo.rb
> file_name = Rails.root + 'config' + 'database.yml'
>
> if File.exists? file_name
>   y = YAML.load_file(file_name)[Rails.env]
>   mongo_url = "mongodb://#{y['host']}#{y['port'].nil? ? '' :
> ":#{y['port']}"}/#{y['database']}"
> end
>
> MongoMapper.config = {
>   Rails.env => {
>     'uri' => (ENV['MONGOHQ_URL'] ? ENV['MONGOHQ_URL'] : mongo_url)
>   }
>
> }
>
> MongoMapper.connect(Rails.env)

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to