Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Rails4部署ActiveRecord::适配器未指定_Mysql_Ruby On Rails 4_Migration_Capistrano - Fatal编程技术网

Mysql Rails4部署ActiveRecord::适配器未指定

Mysql Rails4部署ActiveRecord::适配器未指定,mysql,ruby-on-rails-4,migration,capistrano,Mysql,Ruby On Rails 4,Migration,Capistrano,在迁移之前,我的部署运行良好。。哪个失败了 rake aborted! DEBUG [874287b0] ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter DEBUG [874287b0] /home/kadoudal/rails/swim-tech.eu/site/swimtech/shared/bundle/ruby/2.1.0/gems/a

在迁移之前,我的部署运行良好。。哪个失败了

    rake aborted!
    DEBUG [874287b0]    ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter
    DEBUG [874287b0]    /home/kadoudal/rails/swim-tech.eu/site/swimtech/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:52:in `resolve_hash_connection'
我运行:cap staging deploy:check:linked_文件,如果成功,database.yml已正确链接并包含:

# encoding: utf-8

 defaults: &defaults
     adapter: mysql2
    host: localhost
    timeout: 60000
    encoding: utf8


production:
     <<: *defaults
    database: mydb_production
    username: xxxxxxxxxxx
    password: xxxxxxxxxxxxxx
编码:utf-8 默认值:&默认值 适配器:mysql2 主机:本地主机 超时:60000 编码:utf8 制作:
忘了我在开一个帽子戏台。。。。而且数据库中没有暂存数据库。yml

我通过在Rackspace上克隆生产服务器创建了一个暂存服务器。在这种情况下,我希望暂存服务器仍然使用“生产”rails环境和生产数据库(在暂存服务器上),因此我在config/deploy/staging.rb文件中设置:

set :stage, :production
而且效果很好