在环境中作为生产启动rails控制台时出现错误消息

时间:2013-03-29 15:19:59

标签: ruby-on-rails database ruby-on-rails-3 production-environment

我正在运行命令“rails s -e = production”并收到以下错误: connection_specification.rb:47:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)

我的config / database.yml的内容:

development:
  adapter: sqlserver
  host: ***.***.***.***
  database: gmi_******
  username: **
  password: **

test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlserver
  host: ***.***.***.***
  database: gmi_******
  username: **
  password: **

我已经查看了所有其他问题,其中一个问题是他在适配器之间没有像“adapter:sqlserver”这样的空间,另一个他有服务器的自定义名称,如“Listing_production”但是没有考虑到它。这在开发中工作正常,但在生产中不起作用。请帮忙!

1 个答案:

答案 0 :(得分:3)

我认为-e=让Rails感到困惑。请改为尝试:rails s -e production