Hi,
I’m trying to switch my Rails app over from using the standard Dockerfile with Puma to use Phusion Passenger. This is because my app relies on Redis but when using Puma and Upstash, the app instance keeps restarting (as described here). I tried using the Redis patch for ActionCable, but it didn’t seem to work.
I followed this guide on how to switch to Phusion, but am getting this error when trying to deploy:
> [13/15] RUN bundle install:
#16 1.541 Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
#16 1.541 installing your bundle as root will break this application for all non-root
#16 1.541 users on this machine.
#16 1.541 Bundler 2.3.7 is running, but your lockfile was generated with 2.4.14. Installing Bundler 2.4.14 and restarting using that version.
#16 3.311 Fetching gem metadata from https://rubygems.org/.
#16 3.355 Fetching bundler 2.4.14
#16 3.407 Installing bundler 2.4.14
#16 3.826 Don't run Bundler as root. Installing your bundle as root will break this
#16 3.826 application for all non-root users on this machine.
#16 3.971 Your Ruby version is 3.1.2, but your Gemfile specified 2.7.0
------
Error: failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c bundle install]: exit code: 18
I specified ruby 2.7.0 in my rails.conf file:
server {
listen 8080;
server_name www.digitin.bishbashbooked.com;
root /app/public;
# The following deploys your Ruby/Python/Node.js/Meteor app on Passenger.
# Not familiar with Passenger, and used (G)Unicorn/Thin/Puma/pure Node before?
# Yes, this is all you need to deploy on Passenger! All the reverse proxying,
# socket setup, process management, etc are all taken care automatically for
# you! Learn more at https://www.phusionpassenger.com/.
passenger_enabled on;
passenger_user app;
# If this is a Ruby app, specify a Ruby version:
# For Ruby 3.1
# passenger_ruby /usr/bin/ruby3.1;
# For Ruby 3.0
# passenger_ruby /usr/bin/ruby3.0;
# For Ruby 2.7
passenger_ruby /usr/bin/ruby2.7;
# For Ruby 2.6
# passenger_ruby /usr/bin/ruby2.6;
# Nginx has a default limit of 1 MB for request bodies, which also applies
# to file uploads. The following line enables uploads of up to 50 MB:
client_max_body_size 50M;
}
so I’m not sure why I am getting this error. I have the Dockerfile as shown in the guide, and within the config directory of my app I have a fly folder with envvars.conf, mkswap.sh and rails.conf. If anyone could help with this that would be great. Or if there are any better ways of getting Redis to work properly with ActionCable/websockets.
My app is running on v2 machines, if that makes any difference.