Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Dumping db structure after migrations fails for projects with spaces in their path

Open Beginner friendly
#453 0 comments 0 reactions 0 assignees View on GitHub

@JackBracken is already working on this.

Since Oct 11, 2026.

  • #454 by @JackBracken — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
cli

Research direction

Search the Hanami CLI code for .exec_load_command, then read the migration flow that invokes it and any related tests. Reproduce by running hanami db migrate from a project path containing spaces; done means the migration completes and the structure dump succeeds with the path intact.

Written by the indexing model from the issue text.

Description

bug help wanted

Describe the bug

If the project's path contains spaces, at the end of a database migration when the database structure is loaded with .exec_load_command those spaces get interpreted as multiple shell arguments, raising an error.

=> database db/hanami_app.sqlite migrated in 0.001s
Error: in prepare, near "out": syntax error
  out/hanami_app
  ^--- error here
!!! => "db/hanami_app.sqlite structure dumped to config/db/structure.sql" FAILED

To Reproduce

Create a directory with a space. Within that directory create a new hanami application with a single migration. Run the migration and the error occurs.

$ mkdir "spaced out" && cd "spaced out"
$ hanami new hanami_app
Created hanami_app/
-> Within hanami_app/
[truncated]

$ cat <<EOF > config/db/migrate/20261011205238_create_table.rb
ROM::SQL.migration do
  change do
    create_table :foo do
      primary_key :bar
      column :baz, :text, null: false
    end
  end
end
EOF

$ bundle exec hanami db migrate
=> database db/hanami_app.sqlite migrated in 0.001s
Error: in prepare, near "out": syntax error
  out/hanami_app
  ^--- error here
!!! => "db/hanami_app.sqlite structure dumped to config/db/structure.sql" FAILED

Expected behavior

Hanami should gracefully handle paths with spaces by quoting them or using some other shell-safe method.

My environment

  • Ruby version: ruby 4.0.6 (2026-07-14 revision 03b6d3f889) +PRISM [arm64-darwin24]
  • OS: macOS
Dominant language
Ruby
Stars
33
Forks
54
Avg merge
12h 48m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hanami/hanami-cli

All issues in hanami/hanami-cli

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.