Postgresql does not work in crystal V-0.35

After upgrading crystal to version v.35:
db = "postgres://username:password@"
in my main application I got this error:

In /usr/share/crystal/src/

 845 | def write_byte(byte : UInt8) : Int64
Error: method must return Int64 but it is returning (Int64 | Nil)

after create a simple new file with only

In lib/pg/src/pq/

 362 | ctx.update(inner.to_unsafe, inner.bytesize.to_u32)
Error: wrong number of arguments for 'OpenSSL::Digest#update' (given 2, expected 1)

I am using will/crystal-pg

Update to that release.

Thanks but why shards install install the older version?

name: pg
version: 0.21.0

    github: crystal-lang/crystal-db
    version: ~> 0.9.0

Because it’s probably respecting your shard.lock file. You need to run shards update, after changing the version in your shard.yml.

1 Like

Thanks, your guess was right.