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

shards install missing micrate dependencies #79

Closed
jackashton opened this issue Sep 28, 2021 · 0 comments
Closed

shards install missing micrate dependencies #79

jackashton opened this issue Sep 28, 2021 · 0 comments

Comments

@jackashton
Copy link

If you include micrate in a shard.yml and run shards install it does not include mysql (and sqlite3) which are dependencies for micrate. This is the error you get when you try build a project with micrate as a dependency.

$ shards build
Dependencies are satisfied
Building: micrate
Error target micrate failed to compile:
Showing last frame. Use --error-trace for full trace.

In lib/micrate/src/micrate-bin.cr:3:1

 3 | require "mysql"
     ^
Error: can't find file 'mysql'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

my project shard.yml

name: example
version: 0.1.0

crystal: 0.36.1

license: MIT

targets:
  micrate:
    main: lib/micrate/src/micrate-bin.cr

dependencies:
  pg:
    github: will/crystal-pg

  granite:
    github: Gembot-ai/granite
    branch: master

  cuid:
    github: rodrigopinto/cuid

  dotenv:
    github: drum445/dotenv

  micrate:
    github: amberframework/micrate

output of shards install

$ shards install
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/gembot-ai/granite.git
Fetching https://github.com/rodrigopinto/cuid.git
Fetching https://github.com/drum445/dotenv.git
Fetching https://github.com/amberframework/micrate.git
Fetching https://github.com/crystal-lang/crystal-db.git
Installing db (0.10.1)
Installing pg (0.24.0)
Installing granite (0.22.0 at 4b14cc0)
Installing cuid (1.0.0 at b773f57)
Installing dotenv (0.3.0)
Installing micrate (0.12.0)
Writing shard.lock

Moving mysql and sqlite from dependencies to dev dependencies seems to be the cause as adding these to my shard.yml and doing shards install fixes this issue. 6d88fb4#diff-cbaa8062ee0fcfb5af8adfd98f69af4766b9ad5bb5e79158abe8da34f6fd7de0

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