未定义的方法auto_upgrade!将Sinatra / DataMapper应用程序推送到Heroku时

时间:2010-09-19 09:49:18

标签: ruby postgresql sinatra heroku datamapper

有没有人知道在Heroku的Bamboo堆栈上运行使用DataMapper的Sinatra应用程序所需的神奇咒语? Bamboo堆栈不包含任何预先安装的系统宝石,无论我尝试什么样的宝石组合,我都会遇到此错误:

undefined method `auto_upgrade!' for DataMapper:Module (NoMethodError)

这就是我在.gems文件中的内容:

sinatra
pg
datamapper
do_postgres
dm-postgres-adapter

这些是我将应用程序推送到Heroku时安装的依赖项:

-----> Heroku receiving push
-----> Sinatra app detected

-----> Installing gem sinatra from http://rubygems.org
       Successfully installed sinatra-1.0
       1 gem installed

-----> Installing gem pg from http://rubygems.org
       Building native extensions.  This could take a while...
       Successfully installed pg-0.9.0
       1 gem installed

-----> Installing gem datamapper from http://rubygems.org
       Successfully installed extlib-0.9.15
       Successfully installed addressable-2.2.1
       Successfully installed dm-core-1.0.2
       Successfully installed dm-aggregates-1.0.2
       Successfully installed dm-migrations-1.0.2
       Successfully installed dm-constraints-1.0.2
       Successfully installed dm-transactions-1.0.2
       Successfully installed fastercsv-1.5.3
       Successfully installed json_pure-1.4.6
       Successfully installed dm-serializer-1.0.2
       Successfully installed dm-timestamps-1.0.2
       Successfully installed dm-validations-1.0.2
       Successfully installed uuidtools-2.1.1
       Successfully installed stringex-1.1.0
       Successfully installed dm-types-1.0.2
       Successfully installed datamapper-1.0.2
       16 gems installed

-----> Installing gem do_postgres from http://rubygems.org
       Building native extensions.  This could take a while...
       Successfully installed data_objects-0.10.2
       Successfully installed do_postgres-0.10.2
       2 gems installed

-----> Installing gem dm-postgres-adapter from http://rubygems.org
       Successfully installed dm-do-adapter-1.0.2
       Successfully installed dm-postgres-adapter-1.0.2
       2 gems installed

使用SQLite3在本地运行应用程序。我错过了另一个PostgreSQL组件吗?

1 个答案:

答案 0 :(得分:10)

dm-migrations gem添加了DataMapper.auto_upgrade!。在自动升级之前,您是否需要dm-migrations或datamapper gem?