Ruby on rails heroku:rake db:迁移mongoDB失败
运行heroku run rake db:migrate并获取错误:Ruby on rails heroku:rake db:迁移mongoDB失败,ruby-on-rails,mongodb,heroku,mongohq,Ruby On Rails,Mongodb,Heroku,Mongohq,运行heroku run rake db:migrate并获取错误: Running `rake db:migrate` attached to terminal... up, run.9259 DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <top (required)> at /app/config/application.rb:10) WARNING: Global
Running `rake db:migrate` attached to terminal... up, run.9259
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <top (required)> at /app/config/application.rb:10)
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Quora::Application#task called at /app/vendor/bundle/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:214:in `initialize_tasks'
rake aborted!
Database should be a Mongo::DB, not NilClass.
我曾尝试寻找解决方案或任何方向来解决问题,但没有成功。我做错了什么
编辑:我将include Rake::DSL
添加到我的Rakefile中,现在初始警告消失了,但我仍然得到:
heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.4751
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <top (required)> at /app/config/application.rb:11)
rake aborted!
Database should be a Mongo::DB, not NilClass.
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
heroku运行rake数据库:迁移
正在运行附加到终端的“rake db:migrate”。。。起来,跑
弃用警告:railtie_名称已弃用,且无效。(从at/app/config/application.rb:11调用)
雷克流产了!
数据库应该是Mongo::DB,而不是NilClass。
任务:TOP=>db:migrate=>environment
(通过使用--trace运行任务查看完整跟踪)
我想你错过了:
adapter: mongodb
以下是我对postgres database.yml的设置:
development:
adapter: postgresql
encoding: unicode
database: db
pool: 50
username: user
password: pwd
host: localhost
您可能还想查看此帖子:
hey@ant我相信mongoid是一个完全的替代品,而不是适配器
development:
adapter: postgresql
encoding: unicode
database: db
pool: 50
username: user
password: pwd
host: localhost