Ruby Passenger: no such file to download the package

I installed Phusion Passenger with Nginx, configured Nginx to point to the right directory. Then I launched the webapp directory and it downloaded gemfiles, but it cannot find gems.

When I visit the site, I get a standard Passenger error page that says:

Error message: no such file to load -- bundler 

Here's the full error: http://tinypic.com/view.php?pic=vpx36r&s=7

I am doing a gem install bundler , so I know that the package is installed, but I think it was looking for the wrong place for gems.

It seems that Passenger has installed ruby-enterprise-1.8.7, and it looks like 1.8 has been installed in this field.

gem env gives me the following:

  - RUBYGEMS VERSION: 1.4.2 - RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux] - INSTALLATION DIRECTORY: /opt/local/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /opt/local/ruby-enterprise-1.8.7-2010.01/bin/ruby - EXECUTABLE DIRECTORY: /opt/local/ruby-enterprise-1.8.7-2010.01/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /opt/local/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8 - /root/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/ 

From what I read, this is a problem with paths, but I don't know what is best to fix.

Here is the conclusion

which ruby:

 /opt/local/ree/bin/ruby 

which links:

 /opt/local/ree/bin/bundle 

I started installing the package in this directory and gave me:

 Your bundle is complete! It was installed into ./vendor/bundle 
+6
source share
1 answer

it looks like you have problems with the outline (as you said). try to check why you have two different ways for your ruby โ€‹โ€‹installation.

I mean, according to your release of env env, you have some installation on

  /opt/local/ruby-enterprise-1.8.7-2010.01/ 

but you also have ruby โ€‹โ€‹and bunlder under

 /opt/local/ree/ 

So, start from here to check if all paths are correct and / or you donโ€™t have any double settings (well, this is enough to check if the ENV codes match).

Another problem might be related to your nginx.conf, you should have something like this:

 [...] http { passenger_root /your/path/to/passenger/gem; passenger_ruby /path/to/ruby; [...] } 

UPDATE (just looked for additional comments using nginx.conf):

as you can see, there is a problem with the paths: you have two paths for installing ruby โ€‹โ€‹and gems:

 /opt/local/ruby-enterprise.... 

and

 /opt/local/ree 

you must delete the latter (not physically, just view the ENV to point to the first)

EDIT: to change your env you can add the following line to your / etc / bash.bashrc (or the whaterver file is loaded from your shell by default):

 PATH="/opt/local/ruby-enterprise-1.8.7-2010.01/bin:$PATH" 

then log out and log in, or for a quick test, run this command from the shell:

source / etc / bash.bashrc

Now, try again to find out which binary is used by default:

 which ruby which gem which rake gem env ... 

everything should have the prefix / opt / local / ruby-enterprise-1.8.7-2010.01 / (which is used in nginx configurations and for the passenger).

UPDATE2 : from the comments it turned out that you have installed at least 3 rubies:

  • ruby from your package manager in / usr / lib / ruby โ€‹โ€‹/ (do you use Linux ubuntu?)
  • ruby in / opt / local / ree /
  • ruby in / opt / local / ruby โ€‹โ€‹-enterprise -....

at this moment it is best:

  • remove all rubies under / opt / local / and all their gems
  • remove (clean) the system provided by ruby โ€‹โ€‹packages (you do not need it)

  • install and install RVM: https://rvm.io

  • reinstall the passenger using RVM: https://rvm.io/integration/passenger/
  • fix nginx.conf to use passenger path and ruby
+8
source

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


All Articles