0

Phusion PassengerでRailsアプリケーションをセットアップしているときに、深刻な問題が発生しました。ポート3000でWebrickサーバーを実行すると、アプリは完全に実行されますが、仮想ホストを介してWebrickサーバーにアクセスしようとすると、引き続きPassengerエラーが発生します。情報は次のとおりです。

乗客がエラーをスローしました

ここに画像の説明を入力してください ここに画像の説明を入力してください

サーバー情報(VMWareの下)

  • ディストリビューターID:Ubuntu
  • 説明:Ubuntu 12.04.1 LTS(GNU / Linux 3.2.0-29-generic-pae i686)
  • リリース:12.04.1

RubyとRailsのバージョン

  • ruby -v=ルビー1.9.3p194(2012-04-20リビジョン35410)[i686-linux]
  • rails -v= Rails 3.2.8
  • rvm -v= rvm 1.16.11(stable)by Wayne E. Seguin、Michal Papis [ https://rvm.io/]

RubyとRailsの場所

  • which ruby=/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
  • which rails=/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194/bin/rails
  • which rvm=/home/wae-group-4/.rvm/bin/rvm
  • which passenger=/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194/bin/passenger

宝石リストの結果

    *** LOCAL GEMS ***

    actionmailer (3.2.8)
    actionpack (3.2.8)
    activemodel (3.2.8)
    activerecord (3.2.8)
    activeresource (3.2.8)
    activesupport (3.2.8)
    arel (3.0.2)
    builder (3.1.2, 3.0.3)
    bundler (1.2.1)
    cgi_multipart_eof_fix (2.5.0)
    cocaine (0.3.1)
    coffee-rails (3.2.2)
    coffee-script (2.2.0)
    coffee-script-source (1.3.3)
    daemon_controller (1.0.0)
    daemons (1.1.9)
    erubis (2.7.0)
    execjs (1.4.0)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    hike (1.2.1)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.1.2)
    json (1.7.5)
    libv8 (3.3.10.4 x86-linux)
    mail (2.4.4)
    mime-types (1.19)
    multi_json (1.3.6)
    nokogiri (1.5.5)
    paperclip (3.0.4)
    passenger (3.0.17)
    pg (0.14.1)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2)
    rack-ssl (1.3.2)
    rack-test (0.6.1)
    rails (3.2.8)
    railties (3.2.8)
    rake (0.9.2.2)
    rb-readline (0.4.2)
    rdoc (3.12)
    rubygems-bundler (1.0.7)
    rvm (1.11.3.5)
    sass (3.2.1)
    sass-rails (3.2.5)
    sprockets (2.1.3)
    sqlite3 (1.3.6)
    therubyracer (0.10.2)
    thor (0.16.0)
    tilt (1.3.3)
    treetop (1.4.10)
    tzinfo (0.3.33)
    uglifier (1.3.0)

バンドルリストの結果

    Gems included by the bundle:
      * actionmailer (3.2.8)
      * actionpack (3.2.8)
      * activemodel (3.2.8)
      * activerecord (3.2.8)
      * activeresource (3.2.8)
      * activesupport (3.2.8)
      * arel (3.0.2)
      * builder (3.0.3)
      * bundler (1.2.1)
      * cocaine (0.3.1)
      * coffee-rails (3.2.2)
      * coffee-script (2.2.0)
      * coffee-script-source (1.3.3)
      * erubis (2.7.0)
      * execjs (1.4.0)
      * hike (1.2.1)
      * i18n (0.6.1)
      * journey (1.0.4)
      * jquery-rails (2.1.2)
      * json (1.7.5)
      * libv8 (3.3.10.4)
      * mail (2.4.4)
      * mime-types (1.19)
      * multi_json (1.3.6)
      * nokogiri (1.5.5)
      * paperclip (3.0.4)
      * pg (0.14.1)
      * polyglot (0.3.3)
      * rack (1.4.1)
      * rack-cache (1.2)
      * rack-ssl (1.3.2)
      * rack-test (0.6.1)
      * rails (3.2.8)
      * railties (3.2.8)
      * rake (0.9.2.2)
      * rb-readline (0.4.2)
      * rdoc (3.12)
      * sass (3.2.1)
      * sass-rails (3.2.5)
      * sprockets (2.1.3)
      * therubyracer (0.10.2)
      * thor (0.16.0)
      * tilt (1.3.3)
      * treetop (1.4.10)
      * tzinfo (0.3.33)
      * uglifier (1.3.0)

rvm情報の結果

      ruby-1.9.3-p194:

        system:
          uname:       "Linux web4 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux"
          system:      "ubuntu/12.04/i386"
          bash:        "/bin/bash => GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)"
          zsh:         " => not installed"

        rvm:
          version:      "rvm 1.16.11 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
          updated:      "4 hours 21 minutes 40 seconds ago"

        ruby:
          interpreter:  "ruby"
          version:      "1.9.3p194"
          date:         "2012-04-20"
          platform:     "i686-linux"
          patchlevel:   "2012-04-20 revision 35410"
          full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]"

        homes:
          gem:          "/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194"
          ruby:         "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194"

        binaries:
          ruby:         "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
          irb:          "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
          gem:          "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
          rake:         "/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194/bin/rake"

        environment:
          PATH:         "/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194/bin:/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/bin:/home/wae-group-4/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
          GEM_HOME:     "/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194"
          GEM_PATH:     "/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194:/home/wae-group-4/.rvm/gems/ruby-1.9.3-p194@global"
          MY_RUBY_HOME: "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194"
          IRBRC:        "/home/wae-group-4/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
          RUBYOPT:      ""
          gemset:       ""

Gemfileの内容

    source 'https://rubygems.org'

    gem 'rails', '3.2.8'

    # Bundle edge Rails instead:
    # gem 'rails', :git => 'git://github.com/rails/rails.git'

    gem 'pg'


    # Gems used only for assets and not required
    # in production environments by default.
    group :assets do
      gem 'sass-rails',   '~> 3.2.3'
      gem 'coffee-rails', '~> 3.2.1'

      # See https://github.com/sstephenson/execjs#readme for more supported runtimes
      gem 'therubyracer', :platforms => :ruby

      gem 'uglifier', '>= 1.0.3'
    end

    gem 'jquery-rails'

    # To use ActiveModel has_secure_password
    # gem 'bcrypt-ruby', '~> 3.0.0'

    # To use Jbuilder templates for JSON
    # gem 'jbuilder'

    # Use unicorn as the app server
    # gem 'unicorn'

    # Deploy with Capistrano
    # gem 'capistrano'

    # To use debugger
    # gem 'debugger'

    gem 'rb-readline'
    gem 'nokogiri'
    gem 'paperclip', '3.0.4'
    gem 'rack-test'

apache2.confの乗客設定

    LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
    PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.17
    PassengerRuby /usr/bin/ruby1.8

/ etc / apache2/sites-enabledのAppConfig

    <VirtualHost *:80>
          ServerName 192.41.170.115
          # !!! Be sure to point DocumentRoot to 'public'!
          DocumentRoot /home/wae-group-4/web12_04/ps2/public
          <Directory /home/wae-group-4/web12_04/ps2/public>
             # This relaxes Apache security settings.
             AllowOverride all
             # MultiViews must be turned off.
             Options -MultiViews
          </Directory>
    </VirtualHost>

/etc/apache2/ports.confの内容

    NameVirtualHost *:80
    Listen 80

    <IfModule mod_ssl.c>
        # If you add NameVirtualHost *:443 here, you will also have to change
        # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
        # to <VirtualHost *:443>
        # Server Name Indication for SSL named virtual hosts is currently not
        # supported by MSIE on Windows XP.
        Listen 443
    </IfModule>

    <IfModule mod_gnutls.c>
        Listen 443
    </IfModule>

バンドルインストールの結果

    Using rake (0.9.2.2) 
    Using i18n (0.6.1) 
    Using multi_json (1.3.6) 
    Using activesupport (3.2.8) 
    Using builder (3.0.3) 
    Using activemodel (3.2.8) 
    Using erubis (2.7.0) 
    Using journey (1.0.4) 
    Using rack (1.4.1) 
    Using rack-cache (1.2) 
    Using rack-test (0.6.1) 
    Using hike (1.2.1) 
    Using tilt (1.3.3) 
    Using sprockets (2.1.3) 
    Using actionpack (3.2.8) 
    Using mime-types (1.19) 
    Using polyglot (0.3.3) 
    Using treetop (1.4.10) 
    Using mail (2.4.4) 
    Using actionmailer (3.2.8) 
    Using arel (3.0.2) 
    Using tzinfo (0.3.33) 
    Using activerecord (3.2.8) 
    Using activeresource (3.2.8) 
    Using cocaine (0.3.1) 
    Using coffee-script-source (1.3.3) 
    Using execjs (1.4.0) 
    Using coffee-script (2.2.0) 
    Using rack-ssl (1.3.2) 
    Using json (1.7.5) 
    Using rdoc (3.12) 
    Using thor (0.16.0) 
    Using railties (3.2.8) 
    Using coffee-rails (3.2.2) 
    Using jquery-rails (2.1.2) 
    Using libv8 (3.3.10.4) 
    Using nokogiri (1.5.5) 
    Using paperclip (3.0.4) 
    Using pg (0.14.1) 
    Using bundler (1.2.1) 
    Using rails (3.2.8) 
    Using rb-readline (0.4.2) 
    Using sass (3.2.1) 
    Using sass-rails (3.2.5) 
    Using therubyracer (0.10.2) 
    Using uglifier (1.3.0) 
            Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

私は何日もこのような問題に直面してきました。Rails、gem、rvmを再インストールする必要がありますか?どんな助けでも大歓迎です!

4

2 に答える 2

6

私はすでに解決策を持っています。check を行ったwhich passengerところ、コンフリクトの問題を引き起こす可能性のある場所が 2 か所あることがわかりました。そこの前のコマンドのため:

  • sudo gem install passenger
  • gem install passenger

それから私はします

  • sudo gem uninstall passenger
  • gem uninstall passenger

そして、やります

  • gem install passenger
  • passenger-install-apache2-module

そして私は申請書を取り戻しました。

于 2012-10-12T16:43:13.990 に答える
1

試用bundle installしたりsudo bundle install、本番環境で使用したりしましたか?

于 2012-10-12T14:54:48.817 に答える