gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 07:12:26 26 4
gpt4 key购买 nike

有谁知道在 Heroku 的 Bamboo 堆栈上启动并运行使用 DataMapper 的 Sinatra 应用程序所需的魔法咒语? Bamboo 堆栈不包含任何预安装的系统 gem,无论我尝试使用何种 gem 组合,我都会不断收到此错误:

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 组件?

最佳答案

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

关于ruby - 未定义的方法 auto_upgrade!将 Sinatra/DataMapper 应用程序推送到 Heroku 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3745205/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com