Redmine没有启动,日志说ActiveRecord :: AdapterNotSpecified,其他一些奇怪的东西

时间:2013-08-17 22:24:32

标签: gem redmine ruby-1.9

FreeBSD 9.2 Apache 2.4 + Passenger 试图启动Redmine 2.3.2

错误:

/usr/local/lib/ruby/gems/1.9/gems/activerecord-3.2.13/lib/active_record
 /connection_adapters/abstract/connection_specification.rb:47:in    
 `resolve_hash_connection': database configuration does not specify
adapter (ActiveRecord::AdapterNotSpecified)

我发现如果我将适配器从adapter: mysql2更改为adapter:mysql2(删除“:”之后的空格),则此错误消失了,但是我还有另一个错误:

/usr/local/lib/ruby/gems/1.9/gems/bundler-1.3.5/lib/bundler/dsl.rb:33:in
`rescue in eval_gemfile': Gemfile syntax error:
(Bundler::GemfileError)

所以我必须在配置adapter: mysql2时使其工作,所以我必须以其他方式解决ActiveRecord :: AdapterNotSpecified错误问题,而不是通过删除那里的空间。

有什么想法吗?

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.25
  - RUBY VERSION: 1.9.3 (2013-06-27 patchlevel 448) [amd64-freebsd9]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9
  - RUBY EXECUTABLE: /usr/local/bin/ruby19
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - amd64-freebsd-9
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9
     - /root/.gem/ruby/1.9
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000

1 个答案:

答案 0 :(得分:0)

在我看来,您没有将变量RAILS_ENV设置为生产。 尝试写入起始脚本RAILS_ENV=production或全局设置变量