Skip to content

Conversation

@frsyuki
Copy link
Contributor

@frsyuki frsyuki commented Jan 11, 2024

I installed https://github.com/sqldef/sqldef-rails and ran bundle exec rake db:schema:dump today. It caused errors due to following 3 reasons:

  • Etc.uname == 'arm64' is not expected. Error message:
KeyError: key not found: "arm64"
  • sqldef repository is moved from k0kubun to sqldef on github. Thus GitHub made one additional redirect. Error message:
Expected 'https://github.com/k0kubun/sqldef/releases/latest/download/psqldef_darwin_arm64.zip' to return 302, but got 301:
  • Binary releases are archived in zip format for windows and darwin. Error message:
Zlib::GzipFile::Error: not in gzip format

This PR fixes the errors and makes the sqldef-rails working on macOS.

Environment:

  • macOS 12.7.2
  • MacBook Pro, Apple M1
  • Output of uname -m:
$ uname -m
arm64
$ which uname
/opt/homebrew/opt/coreutils/libexec/gnubin/uname
$ /usr/bin/uname -m
arm64

Binary releases at https://github.com/sqldef/sqldef use tar.gz for linux
while zip for windows and darwin.
Github returns an additional 302 to follow the repository move which
had made the downloading code broken.
This change is optional as long as the repository is kept at
sqldef/sqldef and GitHub doesn't change how it redirects but works as a
nice safeguard.
Copy link
Contributor

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@k0kubun k0kubun merged commit 8b0200e into sqldef:master Aug 4, 2025
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

Successfully merging this pull request may close these issues.

2 participants