Has anyone had experience deploying flyctl in other PaaS providers (ala Heroku)?
I have a build script that does: curl -L https://fly.io/install.sh | sh but when I ssh into the instance and try flyctl I’m getting errors like below:
$ flyctl --help
ERROR: Cannot find the flyctl executable for x86_64-linux in /opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.1.19/exe
If you're using bundler, please make sure you're on the latest bundler version:
gem install bundler
bundle update --bundler
Then make sure your lock file includes this platform by running:
bundle lock --add-platform x86_64-linux
bundle install
See `bundle lock --help` output for details.
Thanks Sam! Unfortunately, it doesn’t seem to work. I have a script called render-build.sh that looks like below. This is their suggested implementation.
#!/usr/bin/env bash
# exit on error
set -o errexit
# added by me
# doesn't work even if added at the end, or not present at all
curl -L https://fly.io/install.sh | sh
# added based on your suggestion, but a form of it was already there
bundle lock --add-platform x86_64-linux
bundle install
bundle exec rake assets:precompile
bundle exec rake assets:clean
bundle exec rake db:migrate
The project’s Gemfile.lock has
PLATFORMS
arm64-darwin-21
ruby
x86_64-darwin-21
x86_64-linux
RUBY VERSION
ruby 3.0.1p64
BUNDLED WITH
2.3.22
Am I understanding correctly that during the bundle install stage the flyctl binary is compiled?
The gemfile actually has the platform specific binaries. And apparently, they aren’t working for you – which is a vote for removing them from the gem; but that’s a problem for another day, for now lets focus on getting you up and running.
Since you can ssh in, can you verify that there is a flyctl binary in /opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.1.19/exe. If you remove the binary can you make forward progress?
$ flyctl
ERROR: Cannot find the flyctl executable for x86_64-linux in /opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.2.0/exe
If you're using bundler, please make sure you're on the latest bundler version:
gem install bundler
bundle update --bundler
Then make sure your lock file includes this platform by running:
bundle lock --add-platform x86_64-linux
bundle install
See `bundle lock --help` output for details.
$ ls a-l /opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.2.0/exe
ls: cannot access 'a-l': No such file or directory
/opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.2.0/exe:
flyctl
$ ls -al /opt/project/.gems/ruby/3.0.0/gems/fly.io-rails-0.2.0/exe
total 12
drwxr-sr-x 2 render render 4096 Nov 9 02:50 .
drwxr-sr-x 4 render render 4096 Nov 9 02:50 ..
-rwxr-xr-x 1 render render 1273 Nov 9 02:50 flyctl