apache - 安装在Ec2上的Passenger模块 broken,Ubuntu,Apache,乘客,Ruby/Rails

  显示原文与译文双语对照的内容
0 0

乘客当前运行的ruby 版本不正确。 我安装了新版 2.1.5,但无法得到这里命令来完成编译。

passenger-install-apache2-module 

Passanger版本

Phusion Passenger version 4.0.55

版本

Server version: Apache/2.4.7 (Ubuntu)

RVM版本

rvm 1.26.4 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

ruby 版本

rvm rubies
 ruby-2.1.2 [ x86_64 ]
=* ruby-2.1.5 [ x86_64 ]
# => - current
# =* - current && default
# * - default

$PATH

/home/ubuntu/.rvm/gems/ruby-2.1.5/bin:/home/ubuntu/.rvm/gems/ruby-2.1.5@global/bin:/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ubuntu/.rvm/bin:/home/ubuntu/.rvm/bin

gem

/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin/gem

RVM信息

ruby-2.1.5:
 system:
 uname:"Linux ip-172-31-33-140 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux"
 system:"ubuntu/14.04/x86_64"
 bash:"/bin/bash => GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)"
 zsh:" => not installed"
 rvm:
 version:"rvm 1.26.4 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
 updated:"14 hours 8 minutes 49 seconds ago"
 path:"/home/ubuntu/.rvm"
 ruby:
 interpreter:"ruby"
 version:"2.1.5p273"
 date:"2014-11-13"
 platform:"x86_64-linux"
 patchlevel:"2014-11-13 revision 48405"
 full_version:"ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]"
 homes:
 gem:"/home/ubuntu/.rvm/gems/ruby-2.1.5"
 ruby:"/home/ubuntu/.rvm/rubies/ruby-2.1.5"
 binaries:
 ruby:"/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin/ruby"
 irb:"/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin/irb"
 gem:"/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin/gem"
 rake:"/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/rake"
 environment:
 PATH:"/home/ubuntu/.rvm/gems/ruby-2.1.5/bin:/home/ubuntu/.rvm/gems/ruby-2.1.5@global/bin:/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ubuntu/.rvm/bin:/home/ubuntu/.rvm/bin"
 GEM_HOME:"/home/ubuntu/.rvm/gems/ruby-2.1.5"
 GEM_PATH:"/home/ubuntu/.rvm/gems/ruby-2.1.5:/home/ubuntu/.rvm/gems/ruby-2.1.5@global"
 MY_RUBY_HOME:"/home/ubuntu/.rvm/rubies/ruby-2.1.5"
 IRBRC:"/home/ubuntu/.rvm/rubies/ruby-2.1.5/.irbrc"
 RUBYOPT:""
 gemset:""

/etc/apache2/mods-available/passenger.conf

<IfModule mod_passenger.c>
 PassengerRoot/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
 PassengerRuby/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby
</IfModule>

/etc/apache2/mods-enabled/passenger.conf

PassengerDefaul Ruby/usr/bin/ruby

/etc/apache2/mods-available/passenger.load

LoadModule passenger_module/usr/lib/apache2/modules/mod_passenger.so

/etc/apache2/mods-enabled/passenger.load

LoadModule passenger_module/usr/lib/apache2/modules/mod_passenger.so

/etc/apache2/apache2.conf

 LoadModule passenger_module/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
 <IfModule mod_passenger.c>
 PassengerRoot/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45
 PassengerDefaultRuby/home/ubuntu/.rvm/gems/ruby-2.1.2/wrappers/ruby
 </IfModule>

问题

我想运行 passenger-install-apache2-module,以便为 ruby 版本生成 mod_passenger.so,这样可以以在 apache2.conf. 中设置它。

当前

定位 mod_passenger.so

/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so

错误

当进入新 ruby gem 文件夹并尝试运行安装passenger命令时。 它编译了很长一段时间,然后说破碎的管道。 我已经尝试了以下命令,并且得到了同样的错误

rvmsudo/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.55/bin/passenger-install-apache2-module
sudo/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.55/bin/passenger-install-apache2-module
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.55/bin/passenger-install-apache2-module 
rvmsudo/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-install-apache2-module
sudo/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-install-apache2-module 
/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-install-apache2-module

我已经在工作间卸载和安装了乘客。 这是错误。

 Welcome to the Phusion Passenger Apache 2 module installer, v4.0.55.
 This installer will guide you through the entire installation process. It
 shouldn't take more than 3 minutes in total.
 Here's what you can expect from the installation process:
 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.
 Don't worry if anything goes wrong. This installer will advise you on how to
 solve any problems.
 Press Enter to continue, or Ctrl-C to abort.
 --------------------------------------------
 Which languages are you interested in?
 Use <space> to select.
 If the menu doesn't display correctly, press '!'
 (*) Ruby
 ( ) Python
> ( ) Node.js
 ( ) Meteor
--------------------------------------------
Checking for required software...
 * Checking for C compiler...
 Found: yes
 Location:/usr/bin/cc
 * Checking for C++ compiler...
 Found: yes
 Location:/usr/bin/c++
 * Checking for Curl development headers with SSL support...
 Found: yes
 curl-config location:/usr/bin/curl-config
 Header location:/usr/include/curl/curl.h
 Version: libcurl 7.35.0
 Usable: yes
 Supports SSL: yes
 * Checking for OpenSSL development headers...
 Found: yes
 Location:/usr/include/openssl/ssl.h
 * Checking for Zlib development headers...
 Found: yes
 Location:/usr/include/zlib.h
 * Checking for Apache 2...
 Found: yes
 Location of httpd:/usr/sbin/apache2
 Apache version: 2.4.7
 * Checking for Apache 2 development headers...
 Found: yes
 Location of apxs2:/usr/bin/apxs2
 * Checking for Rake (associated with/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby)...
 Found: yes
 Location:/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/rake
 * Checking for OpenSSL support for Ruby...
 Found: yes
 * Checking for RubyGems...
 Found: yes
 * Checking for Ruby development headers...
 Found: yes
 Location:/home/ubuntu/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby.h
 * Checking for rack...
 Found: yes
 * Checking for Apache Portable Runtime (APR) development headers...
 Found: yes
 Location:/usr/bin/apr-1-config
 Version: 1.5.1
 * Checking for Apache Portable Runtime Utility (APU) development headers...
 Found: yes
 Location:/usr/bin/apu-1-config
 Version: 1.5.3
--------------------------------------------
Sanity checking Apache installation...
All good!
--------------------------------------------
Compiling and installing Apache 2 module...
cd/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.55
#/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/rake RELEASE=yes apache2:clean apache2
rm -rf buildout/cache
rm -rf buildout/common/libboost_oxt.a buildout/common/libboost_oxt
rm -f buildout/common/libpassenger_common/Logging.o buildout/common/libpassenger_common/Exceptions.o buildout/common/libpassenger_common/Utils/SystemTime.o buildout/common/libpassenger_common/Utils/StrIntUtils.o buildout/common/libpassenger_common/Utils/IOUtils.o buildout/common/libpassenger_common/Utils.o
rm -f buildout/common/libpassenger_common/Utils/Base64.o buildout/common/libpassenger_common/Utils/CachedFileStat.o buildout/common/libpassenger_common/Utils/LargeFiles.o buildout/common/libpassenger_common/ApplicationPool2/Implementation.o buildout/common/libpassenger_common/ApplicationPool2/AppTypes.o buildout/common/libpassenger_common/AgentsStarter.o buildout/common/libpassenger_common/AgentsBase.o buildout/common/libpassenger_common/Utils/MD5.o buildout/common/libpassenger_common/Utils/fib.o buildout/common/libpassenger_common/Utils/jsoncpp.o
rm -f buildout/common/libpassenger_common/agents/LoggingAgent/FilterSupport.o
rm -rf buildout/common/libpassenger_common
rm -rf buildout/agents/
rm -rf buildout/apache2/module_libboost_oxt.a buildout/apache2/module_libboost_oxt
rm -f buildout/apache2/module_libpassenger_common/Logging.o buildout/apache2/module_libpassenger_common/Exceptions.o buildout/apache2/module_libpassenger_common/Utils/SystemTime.o buildout/apache2/module_libpassenger_common/Utils/StrIntUtils.o buildout/apache2/module_libpassenger_common/Utils/IOUtils.o buildout/apache2/module_libpassenger_common/Utils.o
rm -f buildout/apache2/module_libpassenger_common/Utils/Base64.o buildout/apache2/module_libpassenger_common/Utils/CachedFileStat.o buildout/apache2/module_libpassenger_common/Utils/LargeFiles.o buildout/apache2/module_libpassenger_common/ApplicationPool2/Implementation.o buildout/apache2/module_libpassenger_common/ApplicationPool2/AppTypes.o buildout/apache2/module_libpassenger_common/AgentsStarter.o buildout/apache2/module_libpassenger_common/AgentsBase.o buildout/apache2/module_libpassenger_common/Utils/MD5.o buildout/apache2/module_libpassenger_common/Utils/fib.o buildout/apache2/module_libpassenger_common/Utils/jsoncpp.o
rm -f buildout/apache2/module_libpassenger_common/agents/LoggingAgent/FilterSupport.o
rm -rf buildout/apache2/module_libpassenger_common
rm -rf buildout/apache2/Configuration.o buildout/apache2/Bucket.o buildout/apache2/Hooks.o buildout/apache2/mod_passenger.o buildout/apache2/mod_passenger.so
mkdir -p buildout/apache2/module_libpassenger_common
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Logging.o -c ext/common/Logging.cpp
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Exceptions.o -c ext/common/Exceptions.cpp
mkdir -p buildout/apache2/module_libpassenger_common/Utils
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Utils/SystemTime.o -c ext/common/Utils/SystemTime.cpp
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Utils/StrIntUtils.o -c ext/common/Utils/StrIntUtils.cpp
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Utils/IOUtils.o -c ext/common/Utils/IOUtils.cpp
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Utils.o -c ext/common/Utils.cpp
mkdir -p buildout/apache2/module_libpassenger_common/ApplicationPool2
c++ -Iext -Iext/common -Iext/libev -fPIC -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -pipe -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -Wno-unused-local-typedefs -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/ApplicationPool2/AppTypes.o -c ext/common/ApplicationPool2/AppTypes.cpp
Write failed: Broken pipe

这里的乘客错误日志是大多数乘客在浏览器中说的,就像你所看到的,它仍然运行着 2.1.2

Your Ruby version is 2.1.2, but your Gemfile specified 2.1.5 (Bundler::RubyVersionMismatch)
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.4/lib/bundler/definition.rb:385:in `validate_ruby!'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.4/lib/bundler.rb:117:in `setup'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/bundler-1.7.4/lib/bundler/setup.rb:17:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `require'
/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/lib/phusion_passenger/loader_shared_helpers.rb:258:in `block in run_load_path_setup_code'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/lib/phusion_passenger/loader_shared_helpers.rb:361:in `running_bundler'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/lib/phusion_passenger/loader_shared_helpers.rb:256:in `run_load_path_setup_code'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/helper-scripts/rack-preloader.rb:100:in `preload_app'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/helper-scripts/rack-preloader.rb:28:in `<main>'
Application root
/etc/projects/myapp
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)
production
Ruby interpreter command
/home/ubuntu/.rvm/gems/ruby-2.1.2/wrappers/ruby
User and groups
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),102(netdev)
Environment variables
APACHE_PID_FILE =/var/run/apache2/apache2.pid
rvm_bin_path =/home/ubuntu/.rvm/bin
GEM_HOME =/home/ubuntu/.rvm/gems/ruby-2.1.2
APACHE_RUN_USER = www-data
SHELL =/bin/bash
IRBRC =/home/ubuntu/.rvm/rubies/ruby-2.1.2/.irbrc
PYTHONUNBUFFERED = 1
PASSENGER_DEBUG_DIR =/tmp/passenger.spawn-debug.XXXXdOCV4S
SERVER_PORT = 80
MY_RUBY_HOME =/home/ubuntu/.rvm/rubies/ruby-2.1.2
USER = ubuntu
DOCUMENT_ROOT =/etc/projects/myapp/public
_system_type = Linux
REQUEST_URI =/
rvm_path =/home/ubuntu/.rvm
IN_PASSENGER = 1
RACK_ENV = production
REMOTE_PORT = 49231
rvm_prefix =/home/ubuntu
PATH =/home/ubuntu/.rvm/gems/ruby-2.1.2/bin:/home/ubuntu/.rvm/gems/ruby-2.1.2@global/bin:/home/ubuntu/.rvm/rubies/ruby-2.1.2/bin:/home/ubuntu/.rvm/gems/ruby-2.1.5/bin:/home/ubuntu/.rvm/gems/ruby-2.1.5@global/bin:/home/ubuntu/.rvm/rubies/ruby-2.1.5/bin:/home/ubuntu/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APACHE_LOG_DIR =/var/log/apache2
WSGI_ENV = production
SERVER_ADMIN = [no address given]
PWD =/etc/projects/myapp
LANG = C
APACHE_RUN_GROUP = www-data
NODE_PATH =/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/node_lib
_system_arch = x86_64
NODE_ENV = production
_system_version = 14.04
REMOTE_ADDR = 108.49.67.170
rvm_version = 1.26.4 (latest)
SERVER_NAME = 54.191.134.234
HOME =/home/ubuntu
SHLVL = 0
RAILS_ENV = production
rvm_ruby_string = ruby-2.1.5
SERVER_SOFTWARE = Apache/2.4.7 (Ubuntu)
LOGNAME = ubuntu
QUERY_STRING = 
SERVER_ADDR = 172.31.33.140
GEM_PATH =/home/ubuntu/.rvm/gems/ruby-2.1.2:/home/ubuntu/.rvm/gems/ruby-2.1.2@global
SERVER_PROTOCOL = HTTP/1.1
PASSENGER_APP_ENV = production
rvm_delete_flag = 0
APACHE_RUN_DIR =/var/run/apache2
APACHE_LOCK_DIR =/var/lock/apache2
REQUEST_METHOD = GET
RUBY_VERSION = ruby-2.1.5
_system_name = Ubuntu
_ORIGINAL_GEM_PATH =/home/ubuntu/.rvm/gems/ruby-2.1.2:/home/ubuntu/.rvm/gems/ruby-2.1.2@global
Ulimits
Unknown
System metrics
------------- General -------------
Kernel version : 3.13.0-24-generic
Uptime : 121d 19h 35m 27s
Load averages : 0.02%, 0.14%, 0.19%
Fork rate : unknown
------------- CPU -------------
Number of CPUs : 1
Average CPU usage : 0% -- 0% user, 0% nice, 0% system, 100% idle
 CPU 1 : 0% -- 0% user, 0% nice, 0% system, 100% idle
I/O pressure : 0%
 CPU 1 : 0%
Interference from other VMs: 0%
 CPU 1 : 0%
------------- Memory -------------
RAM total : 588 MB
RAM used : 96 MB (16%)
RAM free : 492 MB
Swap total : 1023 MB
Swap used : 57 MB (6%)
Swap free : 966 MB
Swap in : unknown
Swap out : unknown
General Ruby interpreter information
RUBY_VERSION = 2.1.2
RUBY_PLATFORM = x86_64-linux
RUBY_ENGINE = ruby
RubyGems version = 2.4.2
Ruby configuration (RbConfig::CONFIG)
DESTDIR = 
MAJOR = 2
MINOR = 1
TEENY = 0
PATCHLEVEL = 95
INSTALL =/usr/bin/install
EXEEXT = 
prefix =/home/ubuntu/.rvm/rubies/ruby-2.1.2
ruby_install_name = ruby
RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = ruby
exec = exec
ruby_pc = ruby-2.1.pc
PACKAGE = ruby
BUILTIN_TRANSSRCS = newline.c
USE_RUBYGEMS = YES
MANTYPE = doc
NROFF =/usr/bin/nroff
vendorarchhdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/vendor_ruby/x86_64-linux
sitearchhdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/site_ruby/x86_64-linux
rubyarchhdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-linux
vendorhdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/vendor_ruby
sitehdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/site_ruby
rubyhdrdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0
RUBY_SEARCH_PATH = 
UNIVERSAL_INTS = 
UNIVERSAL_ARCHNAMES = 
configure_args = '--prefix=/usr/local/rvm/rubies/ruby-2.1.2' '--enable-load-relative' '--sysconfdir=/etc' '--disable-install-doc' '--enable-shared'
vendorarchdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/vendor_ruby/2.1.0/x86_64-linux
vendorlibdir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/vendor_ruby/2.1.0
vendordir =/home/ubuntu/.rvm/rubies/ruby-2.1.2/lib/ruby/vendor_ruby

我一直在看很多有用的材料,但是我一直在同一个问题中运行。 https://rvm.io/deployment/passenger是否可以在不重新编译的情况下更改旅客 ruby 版本http://terratakashi.logdown.com/posts/190823-use-different-rvm-gemset-for-rails-app-on-apache-server

对于action工作和服务器工作,我无经验,因这里我不确定内存分配或者使用是否是问题的一部分。

交换

Filename Type Size Used Priority
/swap file 1048572 58752 -1

任何指导都是伟大的 !

更新

我从未让编译器完成,但是在每一个 @BMW 指导下执行以下步骤,我重新加载了服务器,站点不再拥有乘客和Gemfile版本冲突。 我的apache.conf 仍然不准确,但事情是这样的:) 。

ubuntu@ip-172-31-33-140:/etc/apache2$ source $HOME/.rvm/scripts/rvm
ubuntu@ip-172-31-33-140:/etc/apache2$ sudo/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-install-apache2-module
/usr/bin/env: ruby_executable_hooks: No such file or directory

乘客配置

/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-config

量量?

Using/home/ubuntu/.rvm/gems/ruby-2.1.5

/home/ubuntu/.rvm/gems/ruby-2.1.5/bin/passenger-config --ruby-command

passenger-config was invoked through the following Ruby interpreter:
 Command:/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby
 Version: ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
 To use in Apache: PassengerRuby/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby
 To use in Nginx : passenger_ruby/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby
 To use with Standalone:/home/ubuntu/.rvm/gems/ruby-2.1.5/wrappers/ruby/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.55/bin/passenger start
## Notes for RVM users
Do you want to know which command to use for a different Ruby interpreter? 'rvm use' that Ruby interpreter, then re-run 'passenger-config --ruby-command'.
时间:原作者:6个回答

0 0

这个问题 Write failed: Broken pipe 以下是你可以尝试的一些步骤:

1. run it with root permission with full path.
2. if you manage ruby with rvm, you need source it first 
 source"$HOME/.rvm/scripts/rvm
3. if the package can be installed directly with `gem install`, just do it.

希望这些帮助。

原作者:
...