Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run micrate on Crystal 0.24.2 #29

Closed
andrewzah opened this issue Apr 11, 2018 · 2 comments
Closed

Can't run micrate on Crystal 0.24.2 #29

andrewzah opened this issue Apr 11, 2018 · 2 comments

Comments

@andrewzah
Copy link

in lib/db/src/db/query_methods.cr:215: can't infer block return type, try to cast the block body with `as`. See: https://github.com/crystal-lang/crystal/wiki/Compiler-error-messages#cant-infer-block-return-type

      query_all(query, *args) do |rs|
      ^~~~~~~~~

crystal version:

Crystal 0.24.2 (2018-03-19)

LLVM: 6.0.0
Default target: x86_64-pc-linux-gnu
@andrewzah andrewzah reopened this Apr 11, 2018
@epergo
Copy link
Contributor

epergo commented Apr 16, 2018

Hello @azah, I ran into this very issue today.

After a couple of tries I finally made it ran, first check that you have set the environment variable DB_URL as specified in Readme and second, if you have created an executable file to run micrate, remember to require your database adapter, in my case was postgres.

My bin/micrate file, for whats is worth:

#! /usr/bin/env crystal
require "pg"
require "micrate"

Micrate::Cli.run

Then I was able to run bin/micrate up as usual. Hope it helps 😄

@andrewzah
Copy link
Author

I forgot to add "pg" in my micrate. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants