Home > Back-end >  Error starting web application - Passenger, Rails, Raspberry PI
Error starting web application - Passenger, Rails, Raspberry PI

Time:12-18

I have a ROR app (version 6.1.4.1) with Ruby 2.7.4 on a Raspberry Pi 4 with 4 GB RAM and a 32 GB SD card. I installed Passenger 6.0.12 using the tarball installation and am running it with nginx. passenger start in the app directory works successfully, but when I try running it as with nginx (/opt/nginx/sbin/nginx) on port 80, I get the above error when visiting the site.

I'm accessing the app via IP address, which is configured in the nginx.conf and the app is installed in /home/pi/src/bogie_can. There is a .bundle directory with a config file in the app directory, and that's where the gems are installed. I'm running the app in "development" mode, which is configured in the server section of the nginx.conf file using passenger_app_env.

The specific error is that the app cannot find racc-1.5.2. The Bundler info is #<struct Bundler::Settings::Path explicit_path="/home/pi/src/bogie_can/.bundle", system_path=false, default_install_uses_path=false>.. So, we note that the .bundle path is correct and in the .bundle/ruby/2.7.0/gems/ directory, racc-1.5.2 is indeed installed and owned by the user "pi".

I've cleared out old bundle installations and tried switching the app user from pi to root (which was nobody) and back. Also, I'm using rbenv, so I also ran rbenv rehash after the fresh bundle install. I've also carefully reviewed the "Detailed diagnostics" from the Passenger error page (which is super helpful!) and do not see anything that is obviously wrong.

Using the Passenger error page as a guide, it seems that:

  1. The gems are indeed installed as needed
  2. The user, either root or pi, have permissions to access the gems
  3. pi is a reasonable user to run the app
  4. The passenger_root and passenger_ruby are coming from the passenger-config about subcommands and are verified as well.

At this point, there must be some configuration I've overlooked or gotten wrong and I would greatly appreciate some questions and pointers.

CodePudding user response:

I believe I found the root cause of the problem.

I had performed a manual installation and did a copy / paste of the instructions to delete the default nginx installation. It would seem that was not fully successful because I noticed an error message upon system boot up that the "nginx.service" was not successfully started.

I fully removed the nginx installation with sudo apt-get purge nginx nginx-common and rebooted.

All is well

  • Related