hanami / cli

Hanami command line
MIT License
26 stars 24 forks source link

Unable to create migrations #134

Closed morissetcl closed 3 months ago

morissetcl commented 4 months ago

Hi,

I am following the Hanami introduction and I tried to generate a migration but it turns out that I have this error.

➜  bookshelf git:(main) ✗ bundle exec rake db:create_migration\[create_books\]
rake aborted!
Don't know how to build task 'db:create_migration' (See the list of available tasks with `rake --tasks`)
/Users/user/.rbenv/versions/3.3.0/bin/bundle:25:in `load'
/Users/user/.rbenv/versions/3.3.0/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)

I am unable to generate a migration. Do you have any insights into why it is not working? More generally I don't have access to the hanami/cli commands and I am not sure why.

FYI my gemfile (I have also try to add gem "hanami-cli" with the same result)

# frozen_string_literal: true

source "https://rubygems.org"

gem "hanami", "~> 2.0"
gem "hanami-router", "~> 2.0"
gem "hanami-controller", "~> 2.0"
gem "hanami-validations", "~> 2.0"

gem "dry-types", "~> 1.0", ">= 1.6.1"
gem "puma"
gem "rake"
gem "pry-byetypo"
gem "pry"
gem "rom", "~> 5.3"
gem "rom-sql", "~> 3.6"
gem "pg"

group :development, :test do
  gem "dotenv"
end

group :cli, :development do
  gem "hanami-reloader"
end

group :cli, :development, :test do
  gem "hanami-rspec"
end

group :development do
  gem "guard-puma", "~> 0.8"
end

group :test do
  gem "rack-test"
end

Thanks!

timriley commented 3 months ago

Hi @morissetcl, thanks for trying Hanami! If this is still an issue for you, could you please bring this question to our forum and include a reproduction repo, if possible?

I've tried our getting started guide multiple times in the lead up to the 2.1 release, and I've been able to create migrations as it demonstrates, so my hunch is that you might've missed a step along the way.