简体   繁体   中英

Problem installing passenger with Nginx with rvm on linux

Tried to install Passenger with Nginx (on EC2 Linux). I'm using ec2-user (instead of Root). Ruby 1.9.2 with RVM.

Passenger gem installs correctly.

But when I try:

passenger-install-nginx-module

I get:

Checking for required software...

 * GNU C++ compiler... not found
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... not found
 * RubyGems... found
 * Rake... found at /home/ec2-user/.rvm/wrappers/ruby-1.9.2-p180/rake
 * rack... found
 * Curl development headers with SSL support... not found
 * OpenSSL development headers... not found
 * Zlib development headers... not found

Although the above exist. for instance if I type:

$> gcc
$> gcc: no input files

Saw somewhere online that I can try using:

rvmsudo passenger-install-nginx-module

but I get a problem:

--------------------------------------------

Checking for required software...

 * GNU C++ compiler... not found
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... not found
 * RubyGems... found
Unable to locate the RVM path. Your RVM installation is probably too old. Please update it with 'rvm update --head && rvm reload && rvm repair all'.

Any ideas?

you have to do this:

rvm remove 1.9.2 
rvm pkg install openssl
rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr

Be sure that a compiler and all dependency libraries are present on the system before attempting to install Rubies and/or Passenger. You can obtain a list of recommended base dependencies for Ruby based applications by running the following command.

user$ rvm requirements

Install all dependencies listed for 'ruby' before attempting to install the interpreter? The list varies by OS.

More information can be found on the RVM basics documentation page, https://rvm.io/rvm/basics/

~Wayne

gcc is the wrong executable, Passenger is looking for g++ . Install it with this:

sudo yum install gcc-c++

and passenger-install-nginx-module should stop complaining about gcc missing

Unable to locate the RVM path.

That could be a symptom of not adding:

[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"

to your .bashrc (or profile or whatever). That can cause all kinds of weird problems.

Am using ruby-1.9.2-p180 with rvm.
cd ~/.rvm/src/ruby-1.9.2-p180/ext/openssl/
ruby extconf.rb
make
make install
passenger-install-gninx-module

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM