Moving to rbenv breaks the passenger (nginx)

I switched from RVM to rbenv on my server. I removed rvm using "rvm implode" and installed rbenv, ruby ​​1.9.2, rails, passenger and nginx modules. I did not change my original nginx.conf without changing the value of user_root as follows:

1st Try: passenger_root /root/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/passenger-3.0.9; passenger_ruby /root/.rbenv/versions/1.9.2-p290/bin/ruby; 2nd Try: passenger_root /root/.rbenv/shims/passenger; passenger_ruby /root/.rbenv/shims/ruby; 

Now, when I try to start the application, I see error.log error:

 [error] 1291#0: *105 open() "/home/passenger/grabber/current/public/view" failed (2: No such file or directory) 

This clearly indicates that the passenger did not start, and the rail application is not recognized. When I try to manually start the passenger, I get the following error:

  [ pid=17605 thr=70022120 file=utils.rb:176 time=2011-10-23 23:40:41.917 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (libruby.so.1.9: cannot open shared object file: No such file or directory - /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/nokogiri.so) (process 17605, thread #<Thread:0x858e7d0>): from /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require' 

I installed nokogiri several times and I see nokogiri on my gem list. I am not sure why moving to Rbenv broke the passenger for me.

+6
source share
2 answers

There seems to be no compatibility between passenger and rbenv (make sure you know this before shooting yourself in the foot) - so I removed rbenv and went back to RVM ...

-12
source

You can use rbenv, nginx and passenger. Some of them went for a system-wide installation. http://blakewilliams.me/blog/4-system-wide-rbenv-install

I am currently testing my development environment, so if you installed rbenv and you have the correct rbenv init in .bashrc :

 gem install passenger rbenv rehash sudo bash -c "source ~/.bashrc && passenger-install-nginx-module" 

You must gem install passenger to get gaskets. Performing a bundle install to install a passenger will not give you this data.

Finally:

 passenger-config --root 

will give you your passenger_root path and:

 rbenv which ruby 

your way passenger_ruby .

The passenger gasket indicates the executable, but passenger_root should be the path to the folder. I tried using a ruby ​​pad, but it does not work. I have not yet delved into why.

By the way, I have the verb nokogiri in my gemfile. Oh, also, if you have .rvmrc and / or config/setup_load_paths.rb , it should be safe to remove them as a passenger autoload kit.

I still need to do a little more tests on this, but so far so good.

+19
source

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


All Articles