Heroku + Sinatra + Datamapper(Heroku + Sinatra + Datamapper)

编程入门 行业动态 更新时间:2024-10-28 14:27:43
Heroku + Sinatra + Datamapper(Heroku + Sinatra + Datamapper)

我的问题部署我的Sinatra + DataMapper应用程序到Heroku。 该应用程序在本地工作,但部署它爆炸。

这是错误:

带有显式:串行选项的整数ID已弃用,请使用串行(./hello.rb:15)/home/slugs/339253_c667ceb_65a5-45e31e8c-0236-4d03-96ec-a59bdabdf788/mnt/.gems/gems/dm-migrations- 1.0.2 / lib / dm-migrations / adapters / dm-postgres-adapter.rb:84:在`property_schema_hash':范围错误值(ArgumentError)

代码如下所示:

Class Post include DataMapper::Resource property :id, Integer, :serial => true property :title, String end Post.auto_migrate! first_post = Post.new first_post.title = "First!" first_post.save

这是一个宝石版本问题,还是我错过了什么?

Im getting issues deploying my Sinatra + DataMapper app to Heroku. The app works locally but deploying it blows up.

Here's the error:

Integer id with explicit :serial option is deprecated, use Serial instead (./hello.rb:15) /home/slugs/339253_c667ceb_65a5-45e31e8c-0236-4d03-96ec-a59bdabdf788/mnt/.gems/gems/dm-migrations-1.0.2/lib/dm-migrations/adapters/dm-postgres-adapter.rb:84:in `property_schema_hash': bad value for range (ArgumentError)

The code looks like this:

Class Post include DataMapper::Resource property :id, Integer, :serial => true property :title, String end Post.auto_migrate! first_post = Post.new first_post.title = "First!" first_post.save

Is this a gem versioning issue, or am I missing something?

最满意答案

看起来你在本地使用了另一个版本的datamapper。

使用: gem list --local检查您的本地版本

建议使用Serial而不是Integer。

You use another version of datamapper locally it seems.

Check your local version with: gem list --local

Also use Serial instead of Integer as proposed.

更多推荐

本文发布于:2023-08-06 05:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1443974.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Heroku   Sinatra   Datamapper

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!