Passenger PassengerAgent does not exist - ruby-on-rails

I'm updating the passenger for my app with rvm. Afterwards I used passenger-config --root to find the passenger and added it to my nginx.conf. This is the directory:
shared/bundle/ruby/2.3.0/gems/passenger-5.0.30
I'm not sure why the passenger root is this one. I thought it'll be the one installed under .rvm. Anyway, I got this error:
Unable to start Phusion Passenger: Support binary PassengerAgent not found...
I am able to use back my previous passenger, and I noticed the difference is the new package has no buildout/support-binaries/PassengerAgent. Am I missing something here?
Setup:
Ubuntu 14.04
rvm 1.29.3
rails 4.2.10
ruby 2.3
capistrano 3

It seems that I installed passenger with rvm. So I need to follow the instructions here and run passenger-install-nginx-module to do it correctly.

Related

Why when outside the installation directory do I get passenger: command not found?

I have just built a RackSpace cloud server with Ubuntu 12 LTS and performed a "standard" Ruby on Rails installation. I created a user (bob) and added it to the sudu group.
I then logged out of root and logged in as bob. Then issued sudo su from the /home/bob directory. I then installed everything needed to run the Rails Application 'as root'.
I then installed the Rails code in /home/bob and passenger started up when I issued:
RAILS_ENV=production passenger start -p 3000
however, since I want to run multiple Rails applications on this server, I then created another directory /home/bob/newapp and installed Rails code there. (ideally I would want to put all the different Rails applications in their own subdirectory below /home/bob)
When I issue the command (shown below) from /home/bob/newapp
RAILS_ENV=production passenger start -p 3000
I get
passenger: command not found
why is passenger only accessible from /home/bob ?
NEWS: just discovered, passenger is 'available' until the moment I complete the edit of the content of /config/database.yml thus as long as I do NOT edit the database.yml file, passenger will start. After I edit database.yml the "passenger: command not found" appears. How bizarre is that?
SNAP: looks like when I installed passenger it used Ruby-2.1.1 however the old application wants ruby-1.9.3-p194. I need to figure out how to get passenger to run with ruby 1.9.3 or install a second version of passenger (???)
More News:
Thank you,Hongli, for your response. I followed your links/suggestion to read the passenger documentation. I had read it before without recognizing the needed information. This time I found the "magical" command:
rvm-exec ruby-version ruby -S (eg: rvm-exec ruby-1.9.3-p194 ruby -S )
this has turned out to be very helpful, although I did end up following a process which has resulted in two different version of passenger being installed.
Read the About environment variables section of the Phusion Passenger manual to learn what "command not found" errors are, why they occur, and what you can generally do about them.
In your case, entering /home/bob automatically makes RVM change your PATH to include a specific Ruby version's bin directory. Read the When the system has multiple Ruby interpreters section of the Phusion Passenger manual to learn how to deal with that.
The article Hongli suggested I read definitely moved me in the correct direction.
The use of: rvm-exec 'ruby-version' ruby -S allows me to get passenger started, provided a version of passenger has been installed using the version of ruby required by the Rails application.
Thus if I load up a Rails application built with ruby-1.9.3-p194, I will need a version of passenger installed with the same version of ruby.
If I load up another Rails application built with ruby-1.9.3-p286, I will need a version of passenger installed with that version of ruby.
Then starting each version of passenger can be accomplished with the rvm-exec command with the appropriate ruby version.
Perhaps there is a more elegant solution, but the above works for me.

Can't install passanger mod_rails

I am trying to install passenger server for my rails application using this guide http://www.modrails.com/documentation/Users%20guide%20Apache.html The problem occurs in step passenger-install-apache2-module.
When I run this command I get this -
WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM
How can I solve this? My OS is Ubuntu 13.10 and I have already installed all necessary packages: apache2-bin apache2-data apache2-mpm-worker libapache2-mod-passenger
As Brad Werth said, https://serverfault.com/questions/546924/installing-phusion-passenger-4-0-20-on-ubuntu-13-10 provides a solution.
This problem is caused by a bug in Phusion Passenger's passenger-install-apache2-module program. Ubuntu 13.10 changed the way the httpd -V command works, so passenger-install-apache2-module was unable to correctly detect the MPM for your Apache, resulting in an incorrect warning message. You can safely ignore this warning.
I've fixed the problem in Phusion Passenger now. The fix will be included in version 4.0.34: https://github.com/phusion/passenger/commit/6f5af46de7cb80dd88ef3b35c7c5c4bfbfa0cfd3

How do I get Passenger to deploy a RoR app on Ubuntu 12.04 LTS?

I'm trying to get a simple 'hello world' RoR app deployed using Apache/Passenger on Ubuntu 12.04 (via Linode). I followed the directions on the Phusion Passenger documentation site. I get the Passenger error screen that says:
Ruby (Rack) application could not be started
The backtrace is here: http://pastebin.com/Sr4PaQvB
My apache virtual host config is here: http://pastebin.com/q2vb0hX8
One thing that is confusing me is why Passenger is not using the ruby (and gems) that I have installed via RVM even though I specifically use SetEnv and 'PassengerRuby` to tell it where to look. I appreciate any advice! Thanks!
The reason why Passenger wasn't loading up the right ruby/gems was because RVM wasn't installed correctly. I reinstalled RVM and reconfigured my app setup for the correct gems and all was well.

RVM, Passenger, NGINX on top of existing Passenger/NGINX

I previously had Passenger 2.2.13 install with NGINX 0.7.65 - I want to install rails 3 so I figured I'd go the RVM route. I followed instructions from http://blog.ninjahideout.com/posts/a-guide-to-a-nginx-passenger-and-rvm-server and am having issues because my previous install is in a different location and I think that is the one being used. When I make the changes to my nginx.conf file I get a 502 Bad Gateway on all of my apps..
Can anyone help me out with remove NGINX, Passenger, RVM, and re-installing fresh?
I am running OS X 10.6.
If the previous version was running ruby 1.8, I would do the following to have both apps running:
Install rvm
Replicate current ruby (ruby version, gems, etc) server configuration for rvm.
This is step should include re-installing passenger gem for the new ruby.
Install ruby 1.9 using rvm and then follow this guide: http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/
I've done this using apache, and now everything is working ok.
This has to do with using RVM and Passenger, passenger by default only has one path for ruby,once updated this worked fine. I've moved away from Passenger locally to avoid dealing with multiple environments.

Passenger with Nginx cannot find rails 2.3.8 gem

I have been trying to setup nginx with passenger for a few days now and keep running into problems. When I go to my Rails application with my browser it says: Missing the Rails 2.3.8 gem. Please gem install -v=2.3.8 rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
If I type gem list in my terminal it shows: rails (3.0.0, 2.3.8, 2.3.5)
What is funny is that passenger will find my ruby gems just fine when I use it with Apache on the same machine! But I would like to experiment with nginx because Apache is not doing what I want.
The machine is Ubuntu 10.04 Server
which ruby Shows: /usr/local/bin/ruby (REE)
These are the passenger directives in the nginx.conf:
passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15;
passenger_ruby /usr/local/bin/ruby;
#Nik Rishav is correct in that you have to be careful when installing Ruby Enterprise Edition (REE) along side the system Ruby. Installing REE incorrectly can cause some very strange things to happen.
While Rails 3.0 could be the cause of your issues, my gut tells me your real issue is one missed step when installing REE. But, just-in-case this doesn't work, a quick Google search will show you any number of good tutorials showing you how to host a Rails app with Phusion Passenger for Nginx. Well, let's give it a go, shall we!
REE runs fine alongside system Ruby, but you have to install it into its own directory. For example:
/opt/ruby-enterprise-X.X.X/bin/ruby
Your other option is to only install REE, but this might not be an option for you. I suspect that when Nginx runs, it does find REE as you have specified it. Did you install Passenger for Nginx from the REE stack?
/opt/ruby-enterprise-X.X.X/bin/passenger-install-apache2-module
If you haven't, you might want to look into that. I'll assume you did.
From your description, it doesn't look like you have told REE where to find your gems. To do this, you need to set REE as the default Ruby Interpreter. To do this, add an entry to the file /etc/environment. On Ubuntu, the directory is /etc/environment. Add REE's bin directory to the PATH environment variable, like this:
PATH="/opt/ruby-enterprise-x.x.x/bin:/usr/local/sbin:/usr/local/bin"
Placing REE first in the PATH will set it as the default Ruby interpreter.
Then restart Nginx, like so:
sudo /etc/init.d/nginx restart
Hopefully this helps. I've had my share of deployment issues and it truly can be frustrating. Wouldn't wish it on anyone...Good luck!
As a check, are you sure your passenger is installed in the correct version of ruby. basically
Both the rubies have separate gems meaning you have to install the other in one..
Check in the /usr/local/lib/ruby/gems/1.8/gems Directory to see if rails 2.3.8 is present. You need to install it in the this ruby.
Both rubies will have separate gem bin files for installation..
possibly /usr/bin/gem is for the system ruby
and /usr/local/bin/gem is for your installation of REE

Resources