私は現在、mongoid.yml で次の設定 (これは機能しませんMONGOLAB_URI
) を使用しており、heroku 環境に環境変数を正しく追加しました。
production:
sessions:
default:
another:
uri: <%= ENV['MONGOLAB_URI'] %>
動作しない次のことも試しました:
production:
uri: <%= ENV['MONGOLAB_URI'] %>
これも機能しません:
production:
sessions:
default:
uri: <%= ENV['MONGOLAB_URI'] %>
Heroku プッシュで次のエラーが発生します。
Running: rake assets:precompile
There is a configuration error with the current mongoid.yml.
Problem:
No database provided for session configuration: :default.
Summary:
Each session configuration must provide a database so Mongoid knows where the default database to persist to. What was provided was: {"another"=>{"uri"=>nil}}.
Resolution:
If configuring via a mongoid.yml, ensure that within your :default section a :database value for the session's default database is defined.
Example:
\_\_development:
\_\_\_\_sessions:
\_\_\_\_\_\_default:
\_\_\_\_\_\_\_\_database: my_app_db
\_\_\_\_\_\_\_\_hosts:
\_\_\_\_\_\_\_\_\_\_- localhost:27017
There is a configuration error with the current mongoid.yml.
Problem:
No database provided for session configuration: :default.
Summary:
Each session configuration must provide a database so Mongoid knows where the default database to persist to. What was provided was: {"another"=>{"uri"=>nil}}.
Resolution:
If configuring via a mongoid.yml, ensure that within your :default section a :database value for the session's default database is defined.
Example:
\_\_development:
\_\_\_\_sessions:
\_\_\_\_\_\_default:
\_\_\_\_\_\_\_\_database: my_app_db
\_\_\_\_\_\_\_\_hosts:
\_\_\_\_\_\_\_\_\_\_- localhost:27017
Asset precompilation completed (15.47s)
ここで何が間違っていますか?私はmongoid.orgの指示に従いました:
http://mongoid.org/en/mongoid/docs/installation.html
私はmongoid 3.0.0.rcを使用しています