Passenger calling wrong interpreter

15 views
Skip to first unread message

Marchand

unread,
Oct 4, 2015, 9:44:49 AM10/4/15
to Phusion Passenger Discussions
a rails 4.1.13 application with postgresql and nginx is running passenger (5.0.20).
It was not serving up  the application  because it is calling a previously installed ruby interpreter:
/home/deploy/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.9.4/lib/bundler/spec_set.rb:92:in `block in materialize'
And the environment variables all point to that same ruby version

The application's Capfile calls:
require 'capistrano/rvm'
set :rvm_type, :user
set :rvm_ruby_version, '2.2.3'

logging into the server, the version appears correct
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

The wrappers all exist for this version
ruby-2.2.3  ruby-2.2.3@global  ruby-2.2.3@dapp

Backtracking, I imploded rvm and re-installed, telling it to use `rvm use 2.2.3` and the command line recognizes the proper 2.2.3 version of ruby.

However the passenger server now returns:
`*** ERROR ***: Cannot execute /home/deploy/.rvm/wrappers/ruby-1.9.3-p551/ruby: No such file or directory (2)`
and yes that wrapper is inexistent at this point.  So somehow, passenger has that wrapper hard-wired into its flow and cannot figure out where...

Hongli Lai

unread,
Oct 4, 2015, 9:54:00 AM10/4/15
to phusion-passenger
You also need to configure the passenger_ruby directive:
https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_ruby
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/4f418b80-aef3-4e7f-aa0c-13ec45ba164d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)

Marchand

unread,
Oct 4, 2015, 12:44:13 PM10/4/15
to phusion-...@googlegroups.com, hon...@phusion.nl


On Sunday, October 4, 2015 at 3:54:00 PM UTC+2, Hongli Lai wrote:
You also need to configure the passenger_ruby directive:
https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_ruby


having re-cast the /etc/nginx/sites-enabled/dapp, in the server block (and verified that there were no other references in default, i.e. under http)
`passenger_ruby ~/.rvm/gems/ruby-2.2.3@dapp/wrappers/ruby;`
it now appears to have gotten the directive.  However the environment variables all point to the original ruby version
`rvm_bin_path=/home/deploy/.rvm/bin
GEM_HOME=/home/deploy/.rvm/gems/ruby-1.9.3-p551`


Marchand

unread,
Oct 4, 2015, 5:44:05 PM10/4/15
to Phusion Passenger Discussions, hon...@phusion.nl
Actually my path interpretation with the tilde was off.  For indexing reference, best bet is to:
• choose which version from list `rvm list`
• rvm use [the_chosen_one]
• check it is active `which ruby`
• `passenger-config about ruby-command`
and passenger will return the exact string to use (in this context the nginx configuration file for the application). 
`passenger_ruby /home/deploy/.rvm/gems/ruby-2.2.3/wrappers/ruby` 
copy and paste...
Reply all
Reply to author
Forward
0 new messages