小编Phi*_*hil的帖子

数据库配置未指定适配器(Sinatra + Heroku + Activerecord)

我收到一个错误(在Sinatra + ActiveRecord Heroku上) Database configuration does not specify adapter.

从一些研究来看,这看起来是因为Heroku期望在机架期间不会使用环境变量.

我从列出数据库URL的db环境文件中删除了env变量,但我仍然遇到相同的错误.

编辑:这也只是前一天使用db文件不变,所以我不知道什么是错的.

2015-09-01T02:44:40.980448+00:00 app[web.1]: I, [2015-09-01T02:44:40.980313 #3]  INFO -- : Refreshing Gem list
2015-09-01T02:44:41.459544+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:171:in `spec': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
2015-09-01T02:44:41.459548+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:50:in `establish_connection'
2015-09-01T02:44:41.459550+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:43:in `database='
2015-09-01T02:44:41.459552+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
2015-09-01T02:44:41.459554+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:35:in `database_file='
2015-09-01T02:44:41.459555+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
2015-09-01T02:44:41.459556+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:19:in `registered'
2015-09-01T02:44:41.459560+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1399:in `block in register'
2015-09-01T02:44:41.459562+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1397:in `each'
2015-09-01T02:44:41.459563+00:00 app[web.1]: …
Run Code Online (Sandbox Code Playgroud)

activerecord heroku sinatra

3
推荐指数
1
解决办法
1356
查看次数

标签 统计

activerecord ×1

heroku ×1

sinatra ×1