Tutorial

How To Deploy a Rails App with Passenger and Apache on Ubuntu 14.04

How To Deploy a Rails App with Passenger and Apache on Ubuntu 14.04

Introduction

In this tutorial, we will demonstrate how to install Phusion Passenger as your Rails-friendly web server, which is easy to install, configure, and maintain. We will integrate it into Apache on Ubuntu 14.04. By the end of this tutorial, we will have a test Rails application deployed on our Droplet.

If you prefer Nginx over Apache, take a look at how to deploy a Rails app with Passenger and Nginx on Ubuntu 14.04 by following the link.

Prerequisites

The first step is to create a new Droplet. For smaller sites it is enough to use the 512 MB plan.

You may want to choose the 32-bit Ubuntu image because of smaller memory consumption (64-bit programs use about 50% more memory then their 32-bit counterparts). However, if you need a bigger machine, or there is a chance that you will upgrade to more than 4 GB of RAM, you should consider the 64-bit version.

Be sure to use Ubuntu 14.04. At the time of this writing, Ubuntu 14.10 does not have a Passanger APT repository yet. Moreover, Ubuntu 14.04 has an additional benefit: it’s a LTS version, which stands for “long term support.” LTS releases are designed to be stable platforms that we can stick with for a long time. Ubuntu guarantees LTS releases will receive security updates and other bug fixes for five years.

  • Ubuntu 14.04 32-bit Droplet

Step 1 — Add a Sudo User

After the Droplet is created, you should create a system user and secure the server. You can do so by following the Initial Server Setup article.

If you want to follow this tutorial, you need a basic user with sudo privileges. We will use the rails user in this example. If your user has another name, make sure that you use correct paths in the next steps.

Step 2 (Optional) — Set Up Your Domain

In order to ensure that your site will be up and visible, you need to set up your DNS records to point your domain name towards your new server. You can find more information on setting up a hostname by following the link.

However, this step is optional, since you can access your site via an IP address.

Step 3 — Install Ruby

We will install Ruby manually from source.

Before we do anything else, we should run an update to make sure that all of the packages we want to install are up to date:

sudo apt-get update

Next, install some libraries and other dependencies. This will make the installation as smooth as possible:

sudo apt-get install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3

Create a temporary folder for the Ruby source files:

mkdir ~/ruby

Move to the new folder:

cd ~/ruby

Download the latest stable Ruby source code. At the time of this writing, this is version 2.1.4. You can get the current latest version from the Ruby website. If a newer version is available, you will need to replace the link in the following command:

wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz

Decompress the downloaded file:

tar -xzf ruby-2.1.4.tar.gz

Select the extracted directory:

cd ruby-2.1.4

Run the configure script. This will take some time as it checks for dependencies and creates a new Makefile, which will contain steps that need to be taken to compile the code:

./configure

Run the make utility, which will use the Makefile to build the executable program. This step can take a bit longer:

make

Now, run the same command with the install parameter. It will try to copy the compiled binaries to the /usr/local/bin folder. This step requires root access to write to this directory:

sudo make install

Ruby should now be installed on the system. We can check it with the following command, which should print the Ruby version:

ruby -v

If your Ruby installation was successful, you should see output like the following:

ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]

Finally, we can delete the temporary folder:

rm -rf ~/ruby

Step 4 — Install Apache

To install Apache, type this command:

sudo apt-get install apache2

Yes, that’s all!

Step 5 — Install Passenger

First, install the PGP key for the repository server:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7

Create an APT source file:

sudo nano /etc/apt/sources.list.d/passenger.list

Insert the following line to add the Passenger repository to the file:

deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

Press CTRL+X to exit, type Y to save the file, and then press ENTER to confirm the file location.

Change the owner and permissions for this file to restrict access to root:

sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list

Update the APT cache:

sudo apt-get update

Finally, install Passenger:

sudo apt-get install libapache2-mod-passenger

Make sure the Passenger Apache module; it maybe enabled already:

sudo a2enmod passenger

Restart Apache:

sudo service apache2 restart

This step will overwrite our Ruby version to an older one. To resolve this, simply remove the incorrect Ruby location and create a new symlink to the correct Ruby binary file:

sudo rm /usr/bin/ruby
sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

Step 6 — Deploy

At this point you can deploy your own Rails application if you have one ready. If you want to deploy an existing app, you can upload your project to the server and skip to the /etc/apache2/sites-available/default step.

For this tutorial, we will create a new Rails app directly on the Droplet. We will need the rails gem to create the new app.

Move to your user’s home directory:

cd ~

Install the rails gem without extra documentation, which makes the installation faster. This will still take a few minutes:

sudo gem install --no-rdoc --no-ri rails

Now we can create a new app. In our example, we will use the name testapp. If you want to use another name, make sure you update the paths in the other commands and files in this section.

We will skip the Bundler installation because we want to run it manually later.

rails new testapp --skip-bundle

Enter the directory:

cd testapp

Now we need to install a JavaScript execution environment. It can be installed as the therubyracer gem. To install it, first open the Gemfile:

nano Gemfile

Find the following line:

# gem 'therubyracer',  platforms: :ruby

Uncomment it:

gem 'therubyracer',  platforms: :ruby

Save the file, and run Bundler:

bundle install

Now, we need to create a virtual host file for our project. We’ll do this by copying the default Apache virtual host:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/testapp.conf

Open the config file:

sudo nano /etc/apache2/sites-available/testapp.conf

Edit it or replace the existing contents so your final result matches the file shown below. Changes you need to make are highlighted in red. Remember to use your own domain name, and the correct path to your Rails app:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /home/rails/testapp/public
    RailsEnv development
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory "/home/rails/testapp/public">
        Options FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>

Basically, this file enables listening to our domain name on port 80, sets an alias for the www subdomain, sets the mail address of our server administrator, sets the root directory for the public directory of our new project, and allows access to our site. You can learn more about Apache virtual hosts by following the link.

To test our setup, we want to see the Rails Welcome aboard page. However, this works only if the application is started in the development environment. Passenger starts the application in the production environment by default, so we need to change this with the RailsEnv option. If your app is ready for production you’ll want to leave this setting out.

If you don’t want to assign your domain to this app, you can skip the ServerName and ServerAlias lines, or use your IP address.

Save the file (CTRL+X, Y, ENTER).

Disable the default site, enable your new site, and restart Apache:

sudo a2dissite 000-default
sudo a2ensite testapp
sudo service apache2 restart

Now your app’s website should be accessible. Navigate to your Droplet’s domain or IP address:

http://droplet_ip_address

Verify that your app is deployed. You should see either your custom application, or the Welcome aboard default Rails page:

Test page

The Rails app is now live on your server.

Step 7 — Update Regularly

To update Ruby, you will need to compile the latest version as shown in Step 4 in this tutorial.

To update Passenger and Apache, you will need to run a basic system update:

sudo apt-get update && sudo apt-get upgrade

However, if there is a new system Ruby version available, it will probably overwrite our Ruby (installed from source). For this reason, you might need to re-run the commands for removing the existing symlink to the Ruby binary file and creating a new (correct) one. They are listed at the end of Step 6 in this tutorial.

After the update process, you will need to restart the web server:

sudo service apache2 restart

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Juraj Kostolanský
Juraj Kostolanský
See author profile
Category:
Tutorial

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
30 Comments
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Thanks, it’s working in development mode but how to make this testapp work in production mode ? the browser (with my ip address) display 500 Internal Server Error

The Welcome abroad page is visible only in development environment. For a production, you will need a real application, not the empty one created by “rails new” only. This will give you the 500.

ok thanks but the second common problem i often read with installing rails 4, passenger and apache is the assets pipeline. I hope you could help us to use the right way in production by a cool simple tutorial like this one in production mode ^^

Can you provide more details about problems with the asset pipeline?

Problems like this : do we have to precompile manually or is it done in automagic ? do we have to launch first “rake assets:precompile” ? Do we have to edit too /config/environments/production.rb ? Do we have to edit config files in rails app to make apache server working with assets ?

Hey friend, can you explain how I would go about uploading my rails app? Also, are there things I have to prepare such as it’s database.yml/other configurations for this setup?

Hi! Every rails app can require different steps to deploy. The app can use specific system programms, require specific configuration in different files, etc. The very basic steps are:

  • setu up the server (web server, database, …)
  • copy source code to the VPS
  • configure the app (database.yml, secrets.yml, production.rb and other app-specific configurations)
  • run database migrations and populate it (seeds)
  • compile assets

I higly recommend using an automation tool (e.g. Capistrano) to automate (some of) these steps.

in production mode and after generating static pages and scaffolding a post , I have still the message 500 Internal Server Error on screen.

Do you have a step-by-step working for production mode ?

Hi. As I said, every app can require different steps to deploy. For this reason, it is really hard to write a tutorial like How to deploy any rails app.

When you get an error like this, always try to look at the log files. I can’t tell you what did you do wrong from the “500” code only. Maybe you didn’t compile assets or there is a problem with the database connection.

Right , Rails deployment for production got many issues when we don’t know the good practices ; This should be a serious problem to simplify for Rails and Passenger teams.

My 500 internal server error was just due to the secrets key that i forgot to add. Now i have issues with 403 forbidden permissions when i use sqlite3 as database , i guess this is why we found only tutorials on internet using mysql (and not sqlite3) as examples in production mode with passenger.

For those as me who get 500 internal server error and never found complete tutorial about the secret key , this is 2 solutions :

First this is how to know what is the cause of your error by reading your error log :

$ sudo tail -50 /var/log/apache2/error.log

This will tell you about the missing secret key for production , then this is two solutions :

SOLUTION 1 :

- in config/secrets.yml file you can read :
    production:
          secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

- generate secret key by typing  :
    $ rake secret
- copy the key value displayed in console to a new entry in the file /etc/apache2/envvars like this :
    export SECRET_KEY_BASE=7f60ca5fd579049542b7bffd5b9bb8bf...

SOLUTION 2 :

- generate secret key by typing  :
    $ rake secret
- copy value key displayed in console to the file config/secrets.yml
- then restart rails :
    $  sudo touch tmp/restart.txt
(don't forget to ignore file secrets.yml in git)  

This comment has been deleted

    In step 5 on a new 14.04 Droplet when doing

    sudo apt-get update

    I got the following error:

    E: The method driver /usr/lib/apt/methods/https could not be found.
    N: Is the package apt-transport-https installed?
    

    If you get this delete the /etc/apt/sources.list.d/passenger.list file and run:

    sudo apt-get install apt-transport-https
    

    once done restart step 5 from the sudo nano /etc/apt/sources.list.d/passenger.list line and all will be well. (source: http://askubuntu.com/a/517693)

    Im stuck

    sudo service apache2 restart apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/passenger.load: Cannot load /usr/lib/apache2/modules/mod_passenger.so into server: /usr/lib/apache2/modules/mod_passenger.so: undefined symbol: ap_unixd_config Action ‘configtest’ failed. The Apache error log may have more information. …fail!

    Jesse Chase
    DigitalOcean Employee
    DigitalOcean Employee badge
    January 5, 2015

    This comment has been deleted

      Jesse Chase
      DigitalOcean Employee
      DigitalOcean Employee badge
      January 5, 2015

      This comment has been deleted

        It may be worthwhile to mention RVM, which makes installing and managing Ruby much easier than manually building from source if you want the latest version of Ruby.

        These are well written instructions. Unfortunately the make on Ruby died with the following:

        linking shared-object fiddle.so /usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(raw_api.o): relocation R_X86_64_32 against `.text’ can not be used when making a shared object; recompile with -fPIC ./libffi-3.2.1/.libs/libffi.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** […/…/.ext/x86_64-linux/fiddle.so] Error 1

        I didn’t want to dig into the make files so I ended up going with the RVM install method

        does anyone noes this error?

        • Restarting web server apache2 (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 [fail]
        • The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

        That means that port 80 is already in use. Maybe you are trying to start multiple copies of Apache? To check out what process is listening on that port you could use the command:** lsof -i:80**

        Juraj, this is a great guide. I just used it to deploy an open source rails app (Fedena) and it was as easy as your guide. Thank you! Quick question, how do we ensure the app gets stared in production mode?

        Thank you! The default environment in Passenger is production (if you didn’s set the RailsEnv option in your Apache settings). There are multiple ways how to determine the current environment:

        • check log/production.log, if there are entries populating it after you hit the app (e.g. open it in your browser), it is in production mode

        • in one of your views use this: <%= Rails.env %>, it should print the current environment

        My apologies. The answer was in the guide. Before realizing that, I changed the RailsEnv directive from “development” to “production”. Thanks!

        There was a passenger update today and after updating my servers, it broke the setup. I can confirm they were a couple of updates from passenger.

        I have setup a new server to test this same setup with a rails app (Project Fedena) and after doing exactly as shown in this guide, I come up with an error: AH01630: client denied by server configuration: /srv/fedena/public/

        I believe this is related to the absence of an index file in the /app/public directory. Any ideas?

        I had this problem today; just full restart of server solved it.

        If your Apache & Phusion Passenger setup was broken by the Phusion Passenger version 5 release, note that a new apt repository has been published that provides access to Phusion Passenger 4 libraries. See: Passenger 4 APT repository now available

        deb https://oss-binaries.phusionpassenger.com/apt/passenger/4 trusty main

        Hello, I have a question about deploying my app, I installed all the gems for my app, I made the migrations and all those things, but when I open the url of my droplet, appears a passenger page and says this:

        Web application could not be started An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem. Raw process output:

        *** ERROR ***: Cannot execute /usr/bin/ruby: No such file or directory (2)

        I suppouse this has something to do with removing the rails directory, this steps:

        sudo rm /usr/bin/ruby sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

        I repeated this steps and restarted the apache2 service but It doesn’t works.

        any idea what’s happening? thanks

        Hi. It seems there is a problem with your ruby installation. Can you paste the output of these commands?

        ls -l /usr/bin/ruby
        /usr/local/bin/ruby -v
        /usr/bin/ruby -v    
        

        @jkostolansky , sounds logical it’s my ruby installation, I installed ruby in a different way because my rails project was made using ruby 2.2.0 with Rails 4.2.0 and in your tutorial the version of ruby is 2.1.3, I installed ruby via rvm

        rvm install ruby

        also, I installed rails in the same way

        rvm install rails

        using sudo rails [command] also throws the No such file or directory,

        these are the outputs of the commands

        user@mydroplet:~$ ls -l /usr/bin/ruby lrwxrwxrwx 1 root root 19 Mar 16 00:48 /usr/bin/ruby -> /usr/local/bin/ruby

        user@mydroplet:~$ /usr/local/bin/ruby -v -bash: /usr/local/bin/ruby: No such file or directory

        user@mydroplet:~$ /usr/bin/ruby -v
        -bash: /usr/bin/ruby: No such file or directory

        I think that the solution is install ruby 2.1.3 in my computer and rebuild my app with ruby 2.1.3 and rails 4.2.0 and follow your tutorial step by step, or (I don’t know if this is possible, im new with rails) change the version of ruby that my app requires, the first time I followed your tutorial, the passenger page’s output was something like the rails interpreter version was incorrect for the one that the app requires so I destroyed that droplet and made a new one but in the step of this tutorial installing ruby 2.1.3 I installed 2.2.0 instead and the new ruby installation is broken so yeah, maybe that’s the problem, still, I don’t know how to solve it or fix the installation.

        thanks for reading and answering my question.

        pd: sorry for my bad English

        Alfredo

        Oh, that’s the problem :) You can do two things:

        1. Install ruby from source and use the appropiate ruby version from this page, like:

          wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz

        2. Or install ruby with RVM and skip these commands:

          sudo rm /usr/bin/ruby sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

        When you installed ruby from RVM and used these commands, they have broken your ruby installation.

        I destroyed the droplet and opened a new one, followed the guide step by step and installing Ruby 2.2.0 using wget, now the error changed, the Passenger page says this:

        cannot load such file -- bundler/setup (LoadError)
          /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
          /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
          /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:278:in `block in run_load_path_setup_code'
          /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:381:in `running_bundler'
          /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
          /usr/share/passenger/helper-scripts/rack-preloader.rb:99:in `preload_app'
          /usr/share/passenger/helper-scripts/rack-preloader.rb:157:in `<module:App>'
          /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
          /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
        

        I executed bundle install and reloaded apache2 service but it doesn’t seems to work :(

        I get the same

        Hello,

        I´m sharing a solution that worked for me.

        First of all you need to check the ruby route in passenger with: $ passenger-config about ruby-command . You will get something like this:

        passenger-config was invoked through the following Ruby interpreter: Command: /home/deh/.rbenv/versions/2.2.3/bin/ruby Version: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

        You need to remember the line that appear in Command:

        At the moment to edit the file: sudo nano /etc/apache2/sites-available/testapp.conf

        you need to add 3 lines: (in PassengerRuby add the line that you get from Command)

        <VirtualHost *:80> ServerName example.com PassengerRuby /home/deh/.rbenv/versions/2.2.3/bin/ruby ServerAlias www.example.com ServerAdmin webmaster@localhost DocumentRoot /home/rails/testapp/public RailsEnv development ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /home/rails/testapp/public> Allow from all Options -MultiViews Require all granted </Directory> </VirtualHost>

        Good luck!

        I got http://46.101.53.95/ forbidden error now

        Hi in the server setup “DocumentRoot /home/rails/testapp/public” , the “rails” is the name of the user right? , I have kept the setup as

        <VirtualHost *:80>
            ServerName mydomain.com
            ServerAlias www.mydomain.com
            ServerAdmin webmaster@localhost
            DocumentRoot /home/root/testapp/public
            RailsEnv development
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
            <Directory "/home/root/testapp/public">
                Options FollowSymLinks
                Require all granted
            </Directory>
        </VirtualHost>
        

        So in terms of this root is the user right? I am getting a forbidden , you dont have permission to access the error.What am i doing wrong.

        Uncomment the require all granted

        I am getting a forbidden access error and in my apache2 error log it is stating that the client is denied by server configuration, what I am doing wrong here, I followed the guide to the dot?

        Hi nilushkin, this forbidden access problem may occur because the apache process is run by the www-data account and doesn’t by default have appropriate permissions to access your site directory within /root. I would suggest moving your rails project to the default apache www directory /var/www and then amending your conf file:

        mv /root/testapp /var/www/testapp
        sudo nano /etc/apache2/sites-available/testapp.conf
        

        Make the following edits within your testapp.conf:

        <VirtualHost *:80>
            ...
            DocumentRoot /var/www/testapp
            ...
            <Directory "/var/www/testapp">
                Options FollowSymLinks
                Require all granted
            </Directory>
        </VirtualHost>
        

        And then restart your server:

        sudo service apache2 restart
        

        Thank youuuuuuuuuuuuuuuuuuuuuuuu :DDDDDDDDDDD thanks for share!

        “You may want to choose the 32-bit Ubuntu image because of smaller memory consumption (64-bit programs use about 50% more memory then their 32-bit counterparts).” I think you meant ‘than’ instead.

        While sudo chmod 600 /etc/apt/sources.list.d/passenger.list, you’ll get error

        An error occurred,  please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong.  The error message was:  unknown Error:  class(E opening sources passenger list ifstream ifstream(13:  Permission denied)  his usually means that your installed ackages have unmet dependencies
        

        To fix this:

        sudo chmod 644 /etc/apt/sources.list.d/passenger.list
        

        I am trying to install the PGP key for the repository server using this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7

        I am getting an error that it has failed, no such file or directory. Can someone please tell me how I can resolve this. Regards, Jennifer Flynn

        Everything works, including production now. But how do I get my actual domain name to point to this instead of only having access via the direct IP address?

        Same issue as here. 403 Forbidden.

        StackOverFlow changed my virtual host- Apache 2.4

        <VirtualHost *:80> ServerName www.mydomain.com PassengerMaxPoolSize 4 ServerAdmin webmaster@localhost DocumentRoot /home/rails/testapp/public PassengerRuby /usr/local/bin/ruby <Directory /home/rails/testapp/public> Require all granted Options FollowSymLinks </Directory> </VirtualHost>

        ============================================= apache error log

        AH01630: client denied by server configuration: /home/rails ===================UPDATE=================== OK, app location was /home/david/testapp. changed that in apache2 conf file and now I am getting.

        Incomplete response received from application,

        but it is serving something. Rails 5.0.0.1, ruby 2.3.2p217, Ubuntu 16.10

        Changed to Development Mode and everything working, except maybe production mode.

        Nice starter tut! I personally like installing ruby from source, and not fooling around with RVM or RBenv

        I already have rails app and when I was upload this “Incomplete response received from application” message appear, why?, and how to fix it ?

        I have tried RAILS_ENV=production rake assets:precompile and restarted the server, but the CSS seems to be loading from localhost instead of the server. How can we configure the asset pipeline to work in production?

        Thank for sharing.

        When I am trying to hit ‘sudo service apache2 restart’, getting error as “AH00112: Warning: DocumentRoot [/home/rails/testapp/public] does not exist”

        Please suggest proper way.

        after doing all the step it gives me Forbidden You don’t have permission to access / on this server. 403

        The Phusion Passenger application server tried to start the web application. But the application itself (and not Passenger) encountered an internal error.

        Error details:

        cannot load such file – bundler/setup (LoadError) /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:363:in activate_gem' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in block in run_load_path_setup_code’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:527:in running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in run_load_path_setup_code’ /usr/share/passenger/helper-scripts/rack-preloader.rb:91:in preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in block in module:App’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in run_block_and_record_step_progress' /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in module:App’ /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in <main>’ The stdout/stderr output of the subprocess so far is:

        Error: The application encountered the following error: cannot load such file – bundler/setup (LoadError) /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:363:in activate_gem' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in block in run_load_path_setup_code’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:527:in running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in run_load_path_setup_code’ /usr/share/passenger/helper-scripts/rack-preloader.rb:91:in preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in block in module:App’ /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in run_block_and_record_step_progress' /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in module:App’ /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in <main>’

        Join the Tech Talk
        Success! Thank you! Please check your email for further details.

        Please complete your information!

        Become a contributor for community

        Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

        DigitalOcean Documentation

        Full documentation for every DigitalOcean product.

        Resources for startups and SMBs

        The Wave has everything you need to know about building a business, from raising funding to marketing your product.

        Get our newsletter

        Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

        New accounts only. By submitting your email you agree to our Privacy Policy

        The developer cloud

        Scale up as you grow — whether you're running one virtual machine or ten thousand.

        Get started for free

        Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

        *This promotional offer applies to new accounts only.