Question

The problem: Heroku responds me with this error after deploy & run from 'master':

Dec 31 10:35:49 rsappqqsag app/web.1: Completed 500 Internal Server Error in 4ms

Dec 31 10:35:49 rsappqqsag app/web.1: Completed 500 Internal Server Error in 4ms

Dec 31 10:35:49 rsappqqsag app/web.1: Optionable::Unknown (:safe is an unknown option. Valid options are: :write, :read, :database, :max_retries, :pool_size, :retry_interval, :refresh_interval, :down_interval, :ssl, :timeout, :instrumenter.):

Dec 31 10:35:49 rsappqqsag app/web.1: app/controllers/bing_controller.rb:16:in `index'

Dec 31 10:35:49 rsappqqsag app/web.1: Optionable::Unknown (:safe is an unknown option. Valid options are: :write, :read, :database, :max_retries, :pool_size, :retry_interval, :refresh_interval, :down_interval, :ssl, :timeout, :instrumenter.):

Dec 31 10:35:49 rsappqqsag app/web.1: app/controllers/bing_controller.rb:16:in `index'

My stack:

  • Ruby 2.0.0
  • Rails 4.0.2
  • Mongoid

My Gemfile: http://pastebin.com/h9SiezJ8

My mongoid.yml: http://pastebin.com/TW8pswaw

I've done all the steps from devcenter.heroku.com/articles/mongolab but nothing. The rails's app it's ok, runs with normality but when I call a function which connect with Mongo responds a 500 server error.

Thank you guys.

Was it helpful?

Solution

Stennie has solved the problem with the comment above:

From the error mentioning ":safe is an unknown option", I would suspect that there is a newer version of Mongoid on the server than your application code expects. The :safe option was removed in Mongooid 4.0.0 and replaced with :write.

Solution (in my case): remove and/or change on mongoid.yml

production:
  sessions:
    default:
      uri: <%= ENV['MONGOLAB_URI'] %>
      options:
        safe: true
        skip_version_check: true

To

production:
  sessions:
    default:
      uri: <%= ENV['MONGOLAB_URI'] %>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top