codeship / rails测试数据库配置错误

时间:2015-09-07 15:54:40

标签: ruby-on-rails continuous-integration codeship

我正在尝试使用代码进行CI并且遇到一个奇怪的错误:

错误:

DEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:"") instead. (called from block in tsort_each at /home/rof/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:226)
rake aborted!
ActiveRecord::AdapterNotSpecified: '' database is not configured. Available: ["development", "test", "production"]

代码行中的设置命令:

rvm use 2.2.0 --install
bundle install
export RAILS_ENV=test
bundle exec rake db:schema:load <----- error begins here, tried adding RAILS_ENV=test which didn't resolve

我的database.yml

development:
  adapter: postgresql
  encoding: utf8
  database: appname_development
  username: postgres
  password: postgres


test:
  adapter: postgresql
  encoding: utf8
  database: appname_test
  username: postgres
  password: postgres

production:
  database: appname_production
  url: <%= ENV['HEROKU_POSTGRESQL_BLACK_URL'] %>
  pool: <%= ENV['DB_POOL'] || ENV['MAX_THREADS'] || 5 %>

0 个答案:

没有答案