我正在尝试对 CI 使用 codeship,但遇到了一个奇怪的错误:
错误:
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"]
Codeship 中的设置命令:
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
我的数据库.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 %>