Ask A Question


You’re not receiving notifications from this thread.

Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

Chris Oliver asked in General

Thanks a lot for this step by step guide!
Anyway, I'm facing a problem with Passenger. After deploying the app, I see this in the nginx logs:

Error opening '/home/deploy/my_app/current/Passengerfile.json' for reading: Permission denied (errno=13); This error means that the Nginx worker process (PID 48756, running as UID 33) does not have permission to access this file. Please read this page to learn how to fix this problem:;

But I don't have any file called Passengerfile.json in my app's directory. Any clue?


My fault. This fixed it:
chmod o+x $HOME


second this observation. This change - although I have never seen an Passengerfile.json file in the application directory before - is necessary to get the application running.

To prove the point I created multiple users on a VPS deployed & had to restate the cammand for each user.


Thanks for the article, nice and clear.

I was following this for 22.04 and ruby 2.7.5 and ran into an openssl when installing.


First thanks - very helpful.
I followed the instructions step by step - the command: 'sudo apt-get install -y nginx-extras libnginx-mod-http-passenger' ended in an error: Unfullfilled dependencies: passenger : Depends: ruby2.7 but is not installable.
Thanks in advance.


I get the same error


Passenger do not yet support 22.04:
I ended up switching to 20.04


Passenger is now up to date. Change sudo sh -c 'echo deb focal main > /etc/apt/sources.list.d/passenger.list'
sudo sh -c 'echo deb jammy main > /etc/apt/sources.list.d/passenger.list'
Nginx-Installing is then successfull.


deploy failed with yarn install, however this stack-overflow solved my problem

ssh into the production server and ran
sudo apt remove cmdtest
sudo apt remove yarn
curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
yarn install

then proceeded with cap production deploy , now have production up and running


Also running into trouble with Passenger on 22.04. Going to try this all over again with 20.04.


I have created 4 droplets. 4 times the same behaviours popped up.
There are deprecated methods:

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

Then there are services that need to be restarted - the list is quite long & I would not know where to start with each one of them as they are more foreign to me than spoken-martian.

FInally, although mosh installs on the droplet:

"The locale requested by LC_CTYPE=UTF-8 isn't available here.
Running `locale-gen UTF-8' may be necessary.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

But running that comand yields no change in behaviour. All this does not occur on 20.04.
Could we be dealing with a still flaky release?


example of 'Daemons using outdated libraries': systemd-logind.service


other deprecation.
sudo apt-key adv --keyserver hkp:// --recv-keys 561F9B9CAC40B2F7
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).


Hi !
I have a 403 forbidden error after deploying the rails app
I added some gems in order to deploy it :
gem 'ed25519', '>= 1.2', '< 2.0'
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
gem 'net-smtp'

I added a line on deploy.rb :
set :passenger_restart_with_touch, true

without it the deploy failed

Now deploying seems ok but I have a 403 forbidden error when I need to acces website, here is the log :
2022/05/30 12:03:53 [error] 10803#10803: *177 directory index of "/home/deploy/azureenne/current/public/" is forbidden, client:, server: _, request: "GET / HTTP/1.1", host: ""

I don't have any index file, root page is home.html.erb


same error, need help


Hi did you solve this problem?


I feel this guide needs a bit of an update for Ubuntu 22.04.


PassengerAgent: error while loading shared libraries: cannot open shared object file: No such file or directory

Getting this error for Ubuntu 22.04


Thanks for this guide. It is really thorough but wasn't thorough enough for me. I wasted a day and a half trying to get my rails app on Ubuntu 22.04. Still haven't managed to do it and am considering pulling the plug at this point.

Several steps appear to be missing such as:

  • needing to add SSH key to the virtual machine and to your github for 'cap production deploy' to connect to github
  • Node needs a higher version of >=14 in order to work with @hotwired/turbo in Rails 7 (copy/pasting from your guide installed 12.22.9 for me)

It would also be amazing if you could add recommended rails versions for these systems or even some kind of guide to save people these headaches.


Chris, I know this isn't technically your fault - but when people are building out linux servers, this type of thing ends up costing hours and hours of devops time - time that most developers loath! ESPECIALLY beginner programmers. I can't imagine how many people have tried this on 22.04 and gave up, blaming themselves.

You should really take a moment to make a note about the issue until it is resolved.


So it doesnt work with 22.04?


Please help mee. Why its says 403 Forbidden


Hi I have problem with step passenger:restart . I got this message:

*** ERROR: Phusion Passenger(R) doesn't seem to be running. If you are sure that it
01 is running, then the causes of this problem could be one of:
01 1. You customized the instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's
01 passenger_instance_registry_dir option, or Phusion Passenger(R) Standalone's
01 --instance-registry-dir command line argument. If so, please set the
01 environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
01 and run this command again.
01 2. The instance directory has been removed by an operating system background
01 service. Please set a different instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
01 option, or Phusion Passenger(R) Standalone's --instance-registry-dir command
01 line argument.


I think it is not OK to have a guide with lastest versions that is autogenerated to rank well in SEO keywords but that actually isn't updated as it is and can't be used without problems. Repos, passenger, node there are a lot of problematic parts.


/home/deploy/myapp/.rbenv-vars, works, but just wondering if it is possible to get the same result with credentials.yml.enc .


Running into problems Rails 7.0.4 with deploy

00:16 bundler:install
The Gemfile's dependencies are satisfied, skipping installation
00:16 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 rake aborted!
01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage

scratching at straws

Yarn init and Yarn install OK

yarn --version

all look ok

package.json there

ssh into server and ran
$HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
as per
Viktor Smári 1,790 XP · on Apr 26, 2022 suggestion.

Could not locate Gemfile or .bundle/ directory

echo $PATH

ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
Bundler version 2.4.3
which bundler

rbenv local

as you can see from above the capistrano reports that the gems are installed also
gem env
RubyGems Environment:

  • RUBY VERSION: 3.2.0 (2022-12-25 patchlevel 0) [x86_64-linux]
  • INSTALLATION DIRECTORY: /home/deploy/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0
  • USER INSTALLATION DIRECTORY: /home/deploy/.local/share/gem/ruby/3.2.0
  • RUBY EXECUTABLE: /home/deploy/.rbenv/versions/3.2.0/bin/ruby
  • GIT EXECUTABLE: /usr/bin/git
  • EXECUTABLE DIRECTORY: /home/deploy/.rbenv/versions/3.2.0/bin
  • SPEC CACHE DIRECTORY: /home/deploy/.local/share/gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: /home/deploy/.rbenv/versions/3.2.0/etc
    • ruby
    • x86_64-linux
    • /home/deploy/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0
    • /home/deploy/.local/share/gem/ruby/3.2.0
    • :update_sources => true
    • :verbose => true
    • :backtrace => true
    • :bulk_threshold => 1000
    • /home/deploy/.rbenv/versions/3.2.0/bin
    • /home/deploy/.rbenv/libexec
    • /home/deploy/.rbenv/plugins/ruby-build/bin
    • /home/deploy/.rbenv/plugins/rbenv-vars/bin
    • /home/deploy/.rbenv/plugins/ruby-build/bin
    • /home/deploy/.rbenv/shims
    • /home/deploy/.rbenv/bin
    • /usr/local/sbin
    • /usr/local/bin
    • /usr/sbin
    • /usr/bin
    • /sbin
    • /bin
    • /usr/games
    • /usr/local/games
    • /snap/bin

if you are getting this error in rails api only then check you CAP file you should change require file
require "capistrano/rails"this with require "capistrano/rails/migrations" and please also go down and chechk there will be another require file require "capistrano/rails/assets comment it
i hope it will remove this error but only for api mode


I'm getting this error on

*** Cleaning stale instance directory /var/run/passenger-instreg/passenger.KDGdRez
Warning: Permission denied @ dir_s_rmdir - /var/run/passenger-instreg/passenger.KDGdRez
Version : 6.0.17
Date : 2023-03-04 23:52:38 +0000
Instance: eRjphKXk (nginx/1.18.0 Phusion_Passenger/6.0.17)

Phusion Passenger(R) is currently not serving any applications.


When running cap production deploy, I get this error message.

00:13 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 rake aborted!
01 ArgumentError: Missing secret_key_base for 'production' environment, set this string with bin/rails credentials:edit


The solution for me was to create a master.key file

You can create the master.key file by running this command:
EDITOR=nano rails credentials:edit

Once that is created, it will also create a credentials.yml.enc file

Ccopy the database.yml / master.key / credentials.yml.enc from your dev server and put it on the production server and then cap production deploy should work

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 71,933+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.