问题描述
有人知道获得使用DataMapper并在Heroku的Bamboo堆栈上运行的Sinatra应用程序所需的魔法咒语吗? Bamboo stack不包含任何预装的系统宝石,无论我尝试使用哪种宝石组合,都会收到此错误:
Does anybody know the magic incantation required to get a Sinatra application that uses DataMapper up and running on Heroku's Bamboo stack? The Bamboo stack doesn't include any pre-installed system gems and no matter what combination of gems I try I keep getting this error:
undefined method `auto_upgrade!' for DataMapper:Module (NoMethodError)
这是我在我的 .gems
文件:
sinatra
pg
datamapper
do_postgres
dm-postgres-adapter
这些是在将应用程序推送到Heroku时安装的依赖关系:
And these are the dependencies that are installed when I push the app to 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组件?
The application works fine locally using SQLite3. Am I missing another PostgreSQL component?
推荐答案
dm-migrations gem添加了DataMapper.auto_upgrade !.您是否在自动升级之前需要dm-migrations或datamapper gem?
The dm-migrations gem adds DataMapper.auto_upgrade!. Are you requiring dm-migrations or the datamapper gem before auto-upgrading?
这篇关于未定义的方法auto_upgrade!当推送Sinatra / DataMapper应用程序到Heroku时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!