关于heroku生产的Sinatra试图加载开发宝石

时间:2015-03-31 09:23:41

标签: heroku sinatra gemfile

尝试学习Sinatra我刚刚为heroku部署了一个简单的应用程序。

我的配置文件:

require './main'
require 'sinatra'
run Sinatra::Application

的Gemfile:

source 'http://rubygems.org'
ruby '1.9.3'
gem 'sinatra'
gem 'slim'
gem 'sass'
gem 'dm-core'
gem 'dm-migrations'
gem 'thin'
gem 'pg', :group => :production
gem 'dm-postgres-adapter', :group => :production
gem 'dm-sqlite-adapter', :group => :development

我在日志中收到以下错误:

2015-03-31T09:13:54.051645+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-31T09:13:57.281158+00:00 heroku[web.1]: Starting process with command `bundle exec ruby main.rb -p 28463`
2015-03-31T09:13:59.598142+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `require': cannot load such file -- dm-sqlite-adapter (LoadError)
2015-03-31T09:13:59.598161+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `load_adapter'
2015-03-31T09:13:59.598164+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:133:in `adapter_class'
2015-03-31T09:13:59.598165+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:13:in `new'
2015-03-31T09:13:59.598167+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.1/lib/dm-core.rb:230:in `setup'
2015-03-31T09:13:59.598169+00:00 app[web.1]:    from /app/song.rb:5:in `block in <top (required)>'
2015-03-31T09:13:59.598171+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1410:in `configure'
2015-03-31T09:13:59.598172+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1989:in `block (2 levels) in delegate'
2015-03-31T09:13:59.598174+00:00 app[web.1]:    from /app/song.rb:4:in `<top (required)>'
2015-03-31T09:13:59.598178+00:00 app[web.1]:    from main.rb:6:in `require'
2015-03-31T09:13:59.598187+00:00 app[web.1]:    from main.rb:6:in `<main>'

2015-03-31T09:14:00.479331+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-31T09:14:00.461548+00:00 heroku[web.1]: Process exited with status 1

我尝试了提议的解决方案here,但它没有用。

提前感谢您的想法

1 个答案:

答案 0 :(得分:0)

我认为您需要在Gemfile中使用datamapper。

gem "datamapper"