require "bundler/capistrano"set :whenever_command, "bundle exec whenever"require "whenever/capistrano"server "72.14.181.01", :web, :app, :db, primary: trueset :application, "appname"set :user, "deploy"set :deploy_to, "/home/#{user}/#{application}"#set :deploy_via, :remote_cacheset :use_sudo, falseset :rails_env, "production"set :scm, "git"set :repository, "[email protected]:appguy/#{application}.git"set :branch, "master"default_run_options[:pty] = truessh_options[:forward_agent] = trueafter "deploy", "deploy:cleanup" # keep only the last 5 releasesafter "deploy:update", "gps_listener:restart"namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end desc "reload the database with seed data" task :seed do run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" endendnamespace :gps_listener do task :start do run "#{sudo} start app-gps" end task :stop do run "#{sudo} stop app-gps" end task :restart do run "#{sudo} stop app-gps && sleep 1 && #{sudo} start app-gps" endendtask :after_update_code do run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" run "cd #{current_path}; RAILS_ENV=#{rails_env} bundle exec rake gps:listen"end我会承认,自从我不得不引导一个新服务器以来已经很长时间了(1-2年),所以用新版本的passenger/nginx重新创建这个遗留应用程序确实很麻烦.我不确定这是乘客本身的问题还是红宝石问题.这是我对nginx btw的乘客配置:/etc/nginx/nginx.conf passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /home/deploy/.rbenv/shims/ruby;这是我的/etc/nginx/site-available/default的默认虚拟主机server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name prod.hcems.com; passenger_enabled on; rails_env production; root /home/deploy/exigencad/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}解决方案问题似乎出在我的.bashrc文件上.文件底部有以下内容:if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completionfiexport PATH="$HOME/.rbenv/bin:$PATH"eval "$(rbenv init -)"export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"没有设置我的rbenv环境变量.一旦将其移至.bashrc的顶部,我就可以进行部署而不会出现错误.现在,乘客启动了应用程序.每当我的gem似乎不起作用时(将我的crontab设置为rake任务),但我将对此提出另一个问题.I have a Rails 3.2.14 app that deploys and operates fine on a production server. I'm working on deploying it to another server to test changes before I push out to production. I'm running the latest version of passenger/nginx and using Capistrano 2.12.0 with Ruby 1.9.3-p194 due to this being a legacy app and I'm trying to mimic the environment.I can deploy the app without a problem, but it won't spawn passenger and start up the app. Here's one of the errors I get in /var/log/nginx/error.log[ 2014-08-10 07:09:08.7782 733/7f2626fb2700 Pool2/Implementation.cpp:284 ]: Could not spawn process for application /home/deploy/exigencad/current: An error occured while starting up the preloader. Error ID: aa5360f9 Error details saved to: /tmp/passenger-error-0aEhJZ.html Message from application: cannot load such file -- bundler/setup (LoadError) /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:263:in `block in run_load_path_setup_code' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'[ 2014-08-10 07:09:08.7874 733/7f2624c8d700 agents/HelperAgent/RequestHandler.h:2305 ]: [Client 20] Cannot checkout session because a spawning error occurred. The identifier of the error is . Please see earlier logs for details about the error.App 1521 stdout: App 1521 stdout: I noticed an error about bundler but I did install the bundler gem, and here's my output running as deploy user or root user:bundle -vBundler version 1.1.4Here's the specific error log file for passenger<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="generator" content="Phusion Passenger"> <title>Web application could not be started</title> <style type="text/css"> body { font-family: Verdana, 'Bitstream Vera Sans', Arial, Sans-Serif; font-size: 10pt; background: white; color: #222222; margin: 0; padding-top: 3em; padding-bottom: 3em; padding-left: 4.5em; padding-right: 4.5em;}h1 { font-size: 17pt; font-weight: medium; color: #533e72; border-bottom: 1px solid #533e72;}h1.title { margin-top: 0;}h1.error_title { color: red; border-bottom: 1px solid red;}a { text-decoration: none;}a:hover { text-decoration: underline;}dt { font-weight: bold; color: #280050;}dd { margin-top: 0.5em; margin-bottom: 1em;}.commands { border: 1px solid #b594e7; background: #ddc6ff; padding: 0.5em; margin: 0.5em; font-family: 'Bitstream Vera Sans Mono', 'Courier New', Monospace;}pre { overflow: auto; white-space: pre-wrap; text-align: left;}table.backtrace th { background: #8470a6; color: white;}table.backtrace th,table.backtrace td { padding: 0.2em; padding-left: 0.4em; padding-right: 0.4em;}table.backtrace tr td { background: #ecdfff;}table.backtrace tr.even td { background: #f7f2ff;}table.backtrace td.index { font-weight: bold;}#site_footer { border-top: solid 1px black; margin-top: 1em; padding-top: 1em; font-size: small; color: #777777;}#site_footer a { color: #65498e;}#site_footer a:hover { color: #9681d9;}#site_header .corporate_identity { display: none;} </style> <link rel="stylesheet" type="text/css" href="http://www.modrails.com/error_pages/1.0/error_page.css"> <style type="text/css"> dd { text-align: left; } dd pre { margin-top: 0; margin-bottom: 0; } </style></head><body> <div id="site_container"> <div id="site_header"> <ul class="corporate_identity"> <li class="logo"><a href="https://www.phusionpassenger.com"><span>Phusion Passenger</span></a></li> </ul> </div> <div id="site_body"> <h1 class="error_title">Web application could not be started</h1> <div id="content"> <pre>cannot load such file -- bundler/setup (LoadError) /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:<wbr>36:<wbr>in `require' /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:<wbr>36:<wbr>in `require' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:<wbr>263:<wbr>in `block in run_load_path_setup_code' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:<wbr>366:<wbr>in `running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:<wbr>261:<wbr>in `run_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:<wbr>100:<wbr>in `preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:<wbr>158:<wbr>in `<module:<wbr>App>' /usr/share/passenger/helper-scripts/rack-preloader.rb:<wbr>29:<wbr>in `<module:<wbr>PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:<wbr>28:<wbr>in `<main>'</pre> <dl> <dt>Error ID</dt> <dd>aa5360f9</dd> <dt>Application root</dt> <dd>/home/deploy/exigencad/current</dd> <dt>Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)</dt> <dd>production</dd> <dt>Ruby interpreter command</dt> <dd><pre>/home/deploy/.rbenv/shims/ruby</pre></dd> <dt>User and groups</dt> <dd><pre>uid=<wbr>1000(deploy) gid=<wbr>1000(deploy) groups=<wbr>1000(deploy),<wbr>27(sudo)</pre></dd> <dt>Environment variables</dt> <dd><pre>RBENV_VERSION =<wbr> 1.9.3-p194TERM =<wbr> xterm-256colorSHELL =<wbr> /bin/bashPYTHONUNBUFFERED =<wbr> 1PASSENGER_DEBUG_DIR =<wbr> /tmp/passenger.spawn-debug.XXXX3H8hx2SERVER_PORT =<wbr> 80USER =<wbr> deployDOCUMENT_ROOT =<wbr> /home/deploy/exigencad/current/publicSCGI =<wbr> 1RBENV_ROOT =<wbr> /home/deploy/.rbenvREQUEST_URI =<wbr> /IN_PASSENGER =<wbr> 1RACK_ENV =<wbr> productionRBENV_HOOK_PATH =<wbr> :<wbr>/home/deploy/.rbenv/rbenv.d:<wbr>/usr/local/etc/rbenv.d:<wbr>/etc/rbenv.d:<wbr>/usr/lib/rbenv/hooksREMOTE_PORT =<wbr> 64649PATH =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/bin:<wbr>/home/deploy/.rbenv/libexec:<wbr>/home/deploy/.rbenv/plugins/ruby-build/bin:<wbr>/usr/local/sbin:<wbr>/usr/local/bin:<wbr>/sbin:<wbr>/bin:<wbr>/usr/sbin:<wbr>/usr/binWSGI_ENV =<wbr> productionPWD =<wbr> /home/deploy/exigencad/currentLANG =<wbr> en_US.UTF-8NODE_PATH =<wbr> /usr/share/passenger/nodeNODE_ENV =<wbr> productionREMOTE_ADDR =<wbr> 75.89.97.25SERVER_NAME =<wbr> prod.hcems.comHOME =<wbr> /home/deploySHLVL =<wbr> 0RAILS_ENV =<wbr> productionRBENV_DIR =<wbr> /usr/share/passenger/helper-scriptsSERVER_SOFTWARE =<wbr> nginx/1.6.0LOGNAME =<wbr> deployQUERY_STRING =<wbr> SERVER_ADDR =<wbr> 72.14.181.99SERVER_PROTOCOL =<wbr> HTTP/1.1PASSENGER_APP_ENV =<wbr> productionREQUEST_METHOD =<wbr> GET</pre></dd> <dt>Ulimits</dt> <dd><pre>Unknown</pre></dd> <dt>System metrics</dt> <dd><pre>------------- General -------------Kernel version :<wbr> 3.15.4-x86_64-linode45Uptime :<wbr> 14h 3m 25sLoad averages :<wbr> 0.01%,<wbr> 0.22%,<wbr> 0.27%Fork rate :<wbr> unknown------------- CPU -------------Number of CPUs :<wbr> 4Average CPU usage :<wbr> 0% -- 0% user,<wbr> 0% nice,<wbr> 0% system,<wbr> 100% idle CPU 1 :<wbr> 0% -- 0% user,<wbr> 0% nice,<wbr> 0% system,<wbr> 100% idle CPU 2 :<wbr> 0% -- 0% user,<wbr> 0% nice,<wbr> 0% system,<wbr> 100% idle CPU 3 :<wbr> 0% -- 0% user,<wbr> 0% nice,<wbr> 0% system,<wbr> 100% idle CPU 4 :<wbr> 0% -- 0% user,<wbr> 0% nice,<wbr> 0% system,<wbr> 100% idleI/O pressure :<wbr> 0% CPU 1 :<wbr> 0% CPU 2 :<wbr> 0% CPU 3 :<wbr> 0% CPU 4 :<wbr> 0%Interference from other VMs:<wbr> 0% CPU 1 :<wbr> 0% CPU 2 :<wbr> 0% CPU 3 :<wbr> 0% CPU 4 :<wbr> 0%------------- Memory -------------RAM total :<wbr> 4002 MBRAM used :<wbr> 205 MB (5%)RAM free :<wbr> 3797 MBSwap total :<wbr> 255 MBSwap used :<wbr> 0 MB (0%)Swap free :<wbr> 255 MBSwap in :<wbr> unknownSwap out :<wbr> unknown</pre></dd> <dt>General Ruby interpreter information</dt> <dd><pre>RUBY_VERSION =<wbr> 1.9.3RUBY_PLATFORM =<wbr> x86_64-linuxRUBY_ENGINE =<wbr> rubyRubyGems version =<wbr> 1.8.23RubyGems paths =<wbr> ["/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1",<wbr> "/home/deploy/.gem/ruby/1.9.1"]</pre></dd> <dt>Ruby configuration (RbConfig::CONFIG)</dt> <dd><pre>DESTDIR =<wbr> MAJOR =<wbr> 1MINOR =<wbr> 9TEENY =<wbr> 1PATCHLEVEL =<wbr> 194INSTALL =<wbr> /usr/bin/install -cEXEEXT =<wbr> prefix =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194ruby_install_name =<wbr> rubyRUBY_INSTALL_NAME =<wbr> rubyRUBY_SO_NAME =<wbr> rubyexec =<wbr> execruby_pc =<wbr> ruby-1.9.pcPACKAGE =<wbr> rubyBUILTIN_TRANSSRCS =<wbr> newline.cUSE_RUBYGEMS =<wbr> YESMANTYPE =<wbr> docNROFF =<wbr> /usr/bin/nroffvendorhdrdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/include/ruby-1.9.1/vendor_rubysitehdrdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/include/ruby-1.9.1/site_rubyrubyhdrdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/include/ruby-1.9.1UNIVERSAL_INTS =<wbr> UNIVERSAL_ARCHNAMES =<wbr> configure_args =<wbr> '--prefix=<wbr>/home/deploy/.rbenv/versions/1.9.3-p194' 'LDFLAGS=<wbr>-L/home/deploy/.rbenv/versions/1.9.3-p194/lib ' 'CPPFLAGS=<wbr>-I/home/deploy/.rbenv/versions/1.9.3-p194/include 'vendordir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_rubysitedir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_rubyruby_version =<wbr> 1.9.1sitearch =<wbr> x86_64-linuxarch =<wbr> x86_64-linuxRI_BASE_NAME =<wbr> riridir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/rirubylibprefix =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/rubyMAKEFILES =<wbr> MakefileTHREAD_MODEL =<wbr> pthreadSYMBOL_PREFIX =<wbr> EXPORT_PREFIX =<wbr> COMMON_HEADERS =<wbr> COMMON_MACROS =<wbr> COMMON_LIBS =<wbr> MAINLIBS =<wbr> ENABLE_SHARED =<wbr> noDLDLIBS =<wbr> -lcSOLIBS =<wbr> LIBRUBYARG_SHARED =<wbr> -Wl,<wbr>-R -Wl,<wbr>/home/deploy/.rbenv/versions/1.9.3-p194/lib -L/home/deploy/.rbenv/versions/1.9.3-p194/lib LIBRUBYARG_STATIC =<wbr> -Wl,<wbr>-R -Wl,<wbr>/home/deploy/.rbenv/versions/1.9.3-p194/lib -L/home/deploy/.rbenv/versions/1.9.3-p194/lib -lruby-staticLIBRUBYARG =<wbr> -Wl,<wbr>-R -Wl,<wbr>/home/deploy/.rbenv/versions/1.9.3-p194/lib -L/home/deploy/.rbenv/versions/1.9.3-p194/lib -lruby-staticLIBRUBY =<wbr> libruby-static.aLIBRUBY_ALIASES =<wbr> libruby.soLIBRUBY_SO =<wbr> libruby.so.1.9.1LIBRUBY_A =<wbr> libruby-static.aRUBYW_INSTALL_NAME =<wbr> rubyw_install_name =<wbr> LIBRUBY_DLDFLAGS =<wbr> LIBRUBY_LDSHARED =<wbr> gcc -sharedwarnflags =<wbr> -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=<wbr>pointer-arith -Werror=<wbr>write-strings -Werror=<wbr>declaration-after-statement -Werror=<wbr>implicit-function-declarationdebugflags =<wbr> -ggdboptflags =<wbr> -O3cxxflags =<wbr> -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=<wbr>pointer-arith -Werror=<wbr>write-strings -Werror=<wbr>declaration-after-statement -Werror=<wbr>implicit-function-declarationcflags =<wbr> -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=<wbr>pointer-arith -Werror=<wbr>write-strings -Werror=<wbr>declaration-after-statement -Werror=<wbr>implicit-function-declarationcppflags =<wbr> -I/home/deploy/.rbenv/versions/1.9.3-p194/include NULLCMD =<wbr> :<wbr>INSTALLDOC =<wbr> allCAPITARGET =<wbr> nodocRDOCTARGET =<wbr> rdocEXECUTABLE_EXTS =<wbr> ARCHFILE =<wbr> LIBRUBY_RELATIVE =<wbr> noEXTOUT =<wbr> .extPREP =<wbr> minirubyTEST_RUNNABLE =<wbr> yessetup =<wbr> SetupEXTSTATIC =<wbr> STRIP =<wbr> strip -S -xTRY_LINK =<wbr> LIBPATHENV =<wbr> LD_LIBRARY_PATHRPATHFLAG =<wbr> -Wl,<wbr>-R%1$-sLIBPATHFLAG =<wbr> -L%1$-sLINK_SO =<wbr> LIBEXT =<wbr> aDLEXT2 =<wbr> DLEXT =<wbr> soLDSHAREDXX =<wbr> g++ -sharedLDSHARED =<wbr> gcc -sharedCCDLFLAGS =<wbr> -fPICSTATIC =<wbr> ARCH_FLAG =<wbr> DLDFLAGS =<wbr> ALLOCA =<wbr> WERRORFLAG =<wbr> -WerrorCHDIR =<wbr> cd -PRMALL =<wbr> rm -frRMDIRS =<wbr> rmdir --ignore-fail-on-non-empty -pRMDIR =<wbr> rmdir --ignore-fail-on-non-emptyCP =<wbr> cpRM =<wbr> rm -fPKG_CONFIG =<wbr> pkg-configDOXYGEN =<wbr> DOT =<wbr> MAKEDIRS =<wbr> /bin/mkdir -pMKDIR_P =<wbr> /bin/mkdir -pINSTALL_DATA =<wbr> /usr/bin/install -c -m 644INSTALL_SCRIPT =<wbr> /usr/bin/install -cINSTALL_PROGRAM =<wbr> /usr/bin/install -cSET_MAKE =<wbr> LN_S =<wbr> ln -sNM =<wbr> nmDLLWRAP =<wbr> WINDRES =<wbr> OBJCOPY =<wbr> objcopyOBJDUMP =<wbr> objdumpASFLAGS =<wbr> AS =<wbr> asAR =<wbr> arRANLIB =<wbr> ranlibtry_header =<wbr> COUTFLAG =<wbr> -o OUTFLAG =<wbr> -o CPPOUTFILE =<wbr> -o conftest.iGNU_LD =<wbr> yesGCC =<wbr> yesEGREP =<wbr> /bin/grep -EGREP =<wbr> /bin/grepCPP =<wbr> gcc -ECXXFLAGS =<wbr> -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=<wbr>pointer-arith -Werror=<wbr>write-strings -Werror=<wbr>declaration-after-statement -Werror=<wbr>implicit-function-declarationCXX =<wbr> g++OBJEXT =<wbr> oCPPFLAGS =<wbr> -I/home/deploy/.rbenv/versions/1.9.3-p194/include -I/home/deploy/.rbenv/versions/1.9.3-p194/include LDFLAGS =<wbr> -L. -L/home/deploy/.rbenv/versions/1.9.3-p194/lib -rdynamic -Wl,<wbr>-export-dynamicCFLAGS =<wbr> -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=<wbr>pointer-arith -Werror=<wbr>write-strings -Werror=<wbr>declaration-after-statement -Werror=<wbr>implicit-function-declarationCC =<wbr> gcctarget_os =<wbr> linuxtarget_vendor =<wbr> unknowntarget_cpu =<wbr> x86_64target =<wbr> x86_64-unknown-linux-gnuhost_os =<wbr> linux-gnuhost_vendor =<wbr> unknownhost_cpu =<wbr> x86_64host =<wbr> x86_64-unknown-linux-gnuRUBYW_BASE_NAME =<wbr> rubywRUBY_BASE_NAME =<wbr> rubybuild_os =<wbr> linux-gnubuild_vendor =<wbr> unknownbuild_cpu =<wbr> x86_64build =<wbr> x86_64-unknown-linux-gnuRUBY_RELEASE_DATE =<wbr> 2012-04-20RUBY_PROGRAM_VERSION =<wbr> 1.9.3BASERUBY =<wbr> echo executable host ruby is required. use --with-baseruby option.;<wbr> falsetarget_alias =<wbr> host_alias =<wbr> build_alias =<wbr> LIBS =<wbr> -lpthread -lrt -ldl -lcrypt -lm ECHO_T =<wbr> ECHO_N =<wbr> -nECHO_C =<wbr> DEFS =<wbr> mandir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/manlocaledir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/localelibdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/libpsdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/doc/rubypdfdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/doc/rubydvidir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/doc/rubyhtmldir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/doc/rubyinfodir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/infodocdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/share/doc/rubyoldincludedir =<wbr> /usr/includeincludedir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/includelocalstatedir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/varsharedstatedir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/comsysconfdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/etcdatadir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/sharedatarootdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/sharelibexecdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/libexecsbindir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/sbinbindir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/binexec_prefix =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194PACKAGE_URL =<wbr> PACKAGE_BUGREPORT =<wbr> PACKAGE_STRING =<wbr> PACKAGE_VERSION =<wbr> PACKAGE_TARNAME =<wbr> PACKAGE_NAME =<wbr> PATH_SEPARATOR =<wbr> :<wbr>SHELL =<wbr> /bin/bashrubylibdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1archdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linuxsitelibdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1sitearchdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/x86_64-linuxvendorlibdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_ruby/1.9.1vendorarchdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_ruby/1.9.1/x86_64-linuxtopdir =<wbr> /home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux</pre></dd> <dt>Ruby load path ($LOAD_PATH)</dt> <dd><pre>/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/x86_64-linux/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_ruby/1.9.1/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_ruby/1.9.1/x86_64-linux/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/vendor_ruby/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux</pre></dd> <dt>Ruby loaded libraries ($LOADED_FEATURES)</dt> <dd><pre>enumerator.so/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/defaults.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/deprecate.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/exceptions.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems.rb/usr/lib/ruby/vendor_ruby/phusion_passenger.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/etc.so/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/fileutils.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tmpdir.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/tmpio.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/platform_info.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/platform_info/operating_system.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/version.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/requirement.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/platform.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/specification.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/path_support.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/platform_info/ruby.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/platform_info/binary_compatibility.rb/home/deploy/.passenger/native_support/4.0.48/ruby-1.9.3-x86_64-linux/passenger_native_support.so/usr/lib/ruby/vendor_ruby/phusion_passenger/native_support.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/socket.so/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/socket.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/thread.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/ruby_core_enhancements.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/tmpdir.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/preloader_shared_helpers.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/constants.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/debug_logging.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/shellwords.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/shellwords.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/fcntl.so/usr/lib/ruby/vendor_ruby/phusion_passenger/message_channel.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/message_client.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/native_support_utils.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/unseekable_socket.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb/home/deploy/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/stringio.so/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/tee_input.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/union_station/connection.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/union_station/transaction.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/utils/lock.rb/usr/lib/ruby/vendor_ruby/phusion_passenger/union_station/core.rb</pre></dd> </dl> </div> </div> <div id="site_footer"> <!-- You are free to modify the footer as you see fit, but we kindly ask of you to preserve to following text. Thank you. --> <div class="container"> Powered by <a href="https://www.phusionpassenger.com/">Phusion Passenger</a>, <tt>mod_rails</tt> / <tt>mod_rack</tt> for Apache and Nginx. </div> </div> </div></body></html>Here's my capistrano deploy.rb in case it helps (note, working on production server, but when I change the IP to the staging server it deploys but doesn't run rake tasks or whenever gem to set crontab):require "bundler/capistrano"set :whenever_command, "bundle exec whenever"require "whenever/capistrano"server "72.14.181.01", :web, :app, :db, primary: trueset :application, "appname"set :user, "deploy"set :deploy_to, "/home/#{user}/#{application}"#set :deploy_via, :remote_cacheset :use_sudo, falseset :rails_env, "production"set :scm, "git"set :repository, "[email protected]:appguy/#{application}.git"set :branch, "master"default_run_options[:pty] = truessh_options[:forward_agent] = trueafter "deploy", "deploy:cleanup" # keep only the last 5 releasesafter "deploy:update", "gps_listener:restart"namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end desc "reload the database with seed data" task :seed do run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" endendnamespace :gps_listener do task :start do run "#{sudo} start app-gps" end task :stop do run "#{sudo} stop app-gps" end task :restart do run "#{sudo} stop app-gps && sleep 1 && #{sudo} start app-gps" endendtask :after_update_code do run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" run "cd #{current_path}; RAILS_ENV=#{rails_env} bundle exec rake gps:listen"endI'll admit, it's been a long time (1-2 years) since I've had to bootstrap a new server so recreating this legacy app with new versions of passenger/nginx is proving troublesome. I'm not sure if it's an issue with passenger itself or if it's a ruby issue.Here's my passenger config for nginx btw:/etc/nginx/nginx.conf passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /home/deploy/.rbenv/shims/ruby;Here's my default virtual host for /etc/nginx/site-available/defaultserver { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name prod.hcems.com; passenger_enabled on; rails_env production; root /home/deploy/exigencad/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }} 解决方案 It looks like the problem was with my .bashrc file.I had the following at the bottom of the file:if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completionfiexport PATH="$HOME/.rbenv/bin:$PATH"eval "$(rbenv init -)"export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"Which was not setting my rbenv environment variable. Once I moved it to the top of .bashrc I could deploy without an error. And passenger now spins up the application.My whenever gem doesn't seem to be working (setting my crontab for rake tasks), but I'll open another question regarding that. 这篇关于Rails Nginx Passenger无法签出会话,因为发生了生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-21 09:04