Currently I want to test the heroine mangoid Mongolab / Mongog.
however, I do not want to work with hero addons, instead I want to configure mongoid to use the mongolab / mongohq database directly through the uri of other parameters. However, this does not work very well.
Here is what I have done so far:
rails new test-mongoid --skip-active-record
Gemfile
gem 'mongoid' gem 'haml' gem 'sass' rails g mongoid:config
simulate a test model
rails g scaffold Article title:string body:string
mongoid.yml
production: host: <%= ENV['MONGOID_HOST'] %> port: <%= ENV['MONGOID_PORT'] %> username: <%= ENV['MONGOID_USERNAME'] %> password: <%= ENV['MONGOID_PASSWORD'] %> database: <%= ENV['MONGOID_DATABASE'] %>
another attempt has already been made with mongoid.yml
production: uri: mongodb://<user>:<password>@<host>:<port>/<database>
filled in with my username, etc.
tested it locally with mongodb, everything worked fine. pushed him to the hero, does not work.
Has anyone already done this in such a way as to bypass these add-ons to the hero and know how to deal with him?
sincerely cschaeffler
EDIT
configured my mongoid.yml like this
production: sessions: default: hosts: - <server>:<port> username: <username> password: <password> database: <dbname>
seems to work ... but if I try to subclass the article index app.herokuapp.com/articles
I get
[2012-08-18 21:54:30] INFO WEBrick 1.3.1 [2012-08-18 21:54:30] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] [2012-08-18 21:54:30] INFO WEBrick::HTTPServer#start: pid=2 port=57443 State changed from starting to up => Booting WEBrick => Rails 3.2.1 application starting in production on http:// 0.0. 0.0:57443 => Ctrl-C to shutdown server => Call with -d to detach Started GET "/articles" for 79.199.52.102 at 2012-08-18 21:54:31 +0000 Processing by ArticlesController#index as HTML Completed 500 Internal Server Error in 264ms ActionView::Template::Error (undefined method `[]' for nil:NilClass): 11: 10: </tr> 14: <td><%= article.title %></td> 15: <td><%= article.body %></td> 13: <tr> Rendered articles/index.html.erb within layouts/application (208.2ms) 9: <th></th> 12: <% for article in @articles %> app/controllers/articles_controller.rb:7:in `index' app/views/articles/index.html.erb:12:in _app_views_articles_index_html_erb__1324099721200765517_18939540' cache: [GET /articles] miss GET safe-atoll-7856.herokuapp.com/articles dyno=web.1 queue=0 wait=0ms service=342ms status=500 bytes=643 Stopping remaining processes with SIGKILL Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM Process exited with status 137