Do I need to install a passenger as a regular gem, even if my application uses a satellite?

I am trying to configure a new server to host a Rails application and want a clean installation of all components, so I decided to use rvm + bundler. His first time configuring a Rails server.

I used to use a firewall with the application, and I understand how it manages application dependencies ... but since I install Passenger, and since it is a dependency on the host environment, I need to make the gem install passenger on and not bind this dependency, not is not it? Or should I put passengers in the gemfile application?

+4
source share
2 answers

The application itself will work without installing a passenger (unicorn, webrick, mongrel, thin, etc.), so the passenger should not really be in the Gemfile. In this case, the right choice as a gem would be the right choice.

Look at the Gemfile as a list of gems that your application uses. The passenger uses your application to transfer data to the user, not the application you use. In the future, you can use a different application server, and you will not need to modify any part of your application, even the Gemfile, to make this change.

However, if your application actually uses the internal features of a passenger or part of a passenger stone, you must enable it. For example, if you used a class declared in the passenger, then you will depend on it and must include it in your Gemfile.

+5
source

You must read the RVM manual for using Passenger with RVM .

In short, since your web server can only use one version of Ruby and one version of Passenger at a time, you only need to install Passenger, but not damage it if it is installed for individual gemset (which means in your Gemfile). Rails also does not need to load the passenger itself (i.e. require 'passenger' ), so this is not a problem either.

(Personally, I prefer to use bundle install --deployment on the server and RVM locally).

+2
source

Source: https://habr.com/ru/post/1342749/


All Articles