ruby-on-rails – Phusion Passenger在使用rvm升级Ruby和Rails之后抛出错误

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Phusion Passenger在使用rvm升级Ruby和Rails之后抛出错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我最近将我的Rails设置升级到3.1.3,并且我遇到了Phusion Passenger在这个服务器上加载旧的应用程序的问题.我在一个testapp上运行的一切,但我仍然有这个应用程序的问题.当我在端口3000上运行Webrick服务器时,我的应用程序运行正常,但是当尝试通过虚拟主机访问它时,我继续获取Passenger错误.这是信息:

乘客抛出错误

Ruby(Rack)应用程序无法启动

错误信息:

在任何源(Bundler :: GemNotFound)中找不到activesupport-3.0.7

例外类:

PhusionPassenger ::不明错误

应用程序根

/家/管理/导轨/ bnkpics

回溯:

#   File    Line    Location
    0   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/spec_set.rb  88  in `materialize'
    1   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/spec_set.rb  82  in `map!'
    2   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/spec_set.rb  82  in `materialize'
    3   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/definition.rb    90  in `specs'
    4   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/definition.rb    135 in `specs_for'
    5   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/definition.rb    124 in `requested_specs'
    6   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/environment.rb   23  in `requested_specs'
    7   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb   11  in `setup'
    8   /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler.rb   110 in `setup'
    9   /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb 326 in `prepare_app_process'
    10  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb  156 in `initialize_server'
    11  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb 572 in `report_app_init_status'
    12  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb  154 in `initialize_server'
    13  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb   204 in `start_synchronously'
    14  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb   180 in `start'
    15  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb  129 in `start'
    16  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 253 in `spawn_rack_application'
    17  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb    132 in `lookup_or_add'
    18  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 246 in `spawn_rack_application'
    19  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb    82  in `synchronize'
    20  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb    79  in `synchronize'
    21  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application'
    22  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application'
    23  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application'
    24  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb   357 in `__send__'
    25  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb   357 in `server_main_loop'
    26  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb   206 in `start_synchronously'
    27  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server  99

服务器信息(Rackspace Cloud Server)

>分销商ID:Ubuntu
>说明:Ubuntu 10.04.3 LTS
>发布:10.04
> Codename:lucid

Ruby和Rails版本

> ruby​​ -v = ruby​​ 1.9.3p0(2011-10-30修订版33570)[x86_64-linux]
rails -v = Rails 3.1.3
> rvm -v = rvm 1.9.2由Wayne E. Seguin(wayneeseguin@gmail.com)[https://rvm.beginrescueend.com/]

Ruby和Rails位置

>哪个ruby = /home/admin/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
>哪个rails = /home/admin/.rvm/gems/ruby-1.9.3-p0@rails313/bin/rails
>哪个rvm = /home/admin/.rvm/bin/rvm
哪个乘客= /usr/bin /乘客

宝石列表的结果

*** LOCAL GEMS ***

    abstract (1.0.0)
    actionmailer (3.1.3,3.0.7)
    actionpack (3.1.3,3.0.7)
    activemodel (3.1.3,3.0.7)
    activerecord (3.1.3,3.0.7)
    activeresource (3.1.3,3.0.7)
    activesupport (3.1.3,3.0.7)
    arel (2.2.1,2.0.10)
    builder (3.0.0,2.1.2)
    bundler (1.0.21)
    carrierwave (0.5.8)
    erubis (2.7.0,2.6.6)
    hike (1.2.1)
    i18n (0.6.0,0.5.0)
    jquery-rails (1.0.19)
    json (1.6.3)
    mail (2.3.0,2.2.19)
    mime-types (1.17.2)
    mini_magick (3.3)
    multi_json (1.0.4)
    polyglot (0.3.3)
    rack (1.3.5,1.2.4)
    rack-cache (1.1)
    rack-mount (0.8.3,0.6.14)
    rack-ssl (1.3.2)
    rack-test (0.6.1,0.5.7)
    rails (3.1.3,3.0.7)
    railties (3.1.3,3.0.7)
    rake (0.9.2.2)
    rdoc (3.11)
    rubygems-update (1.8.12,1.8.11)
    sprockets (2.1.2,2.0.3)
    sqlite3 (1.3.5)
    subexec (0.2.0,0.1.0)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
    tzinfo (0.3.31)

捆绑列表的结果

Gems included by the bundle:
  * abstract (1.0.0)
  * actionmailer (3.0.7)
  * actionpack (3.0.7)
  * activemodel (3.0.7)
  * activerecord (3.0.7)
  * activeresource (3.0.7)
  * activesupport (3.0.7)
  * arel (2.0.10)
  * builder (2.1.2)
  * bundler (1.0.21)
  * carrierwave (0.5.8)
  * erubis (2.6.6)
  * i18n (0.5.0)
  * jquery-rails (1.0.19)
  * mail (2.2.19)
  * mime-types (1.17.2)
  * mini_magick (3.3)
  * polyglot (0.3.3)
  * rack (1.2.4)
  * rack-mount (0.6.14)
  * rack-test (0.5.7)
  * rails (3.0.7)
  * railties (3.0.7)
  * rake (0.9.2.2)
  * sqlite3 (1.3.5)
  * subexec (0.1.0)
  * thor (0.14.6)
  * treetop (1.4.10)
  * tzinfo (0.3.31)

rvm信息的结果

ruby-1.9.3-p0@rails313:

      system:
        uname:       "Linux ror-stack 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux"
        bash:        "/bin/bash => GNU bash,version 4.1.5(1)-release (x86_64-pc-linux-gnu)"
        zsh:         " => not installed"

      rvm:
        version:      "rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

      ruby:
        interpreter:  "ruby"
        version:      "1.9.3p0"
        date:         "2011-10-30"
        platform:     "x86_64-linux"
        patchlevel:   "2011-10-30 revision 33570"
        full_version: "ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]"

      homes:
        gem:          "/home/admin/.rvm/gems/ruby-1.9.3-p0@rails313"
        ruby:         "/home/admin/.rvm/rubies/ruby-1.9.3-p0"

      binaries:
        ruby:         "/home/admin/.rvm/rubies/ruby-1.9.3-p0/bin/ruby"
        irb:          "/home/admin/.rvm/rubies/ruby-1.9.3-p0/bin/irb"
        gem:          "/home/admin/.rvm/rubies/ruby-1.9.3-p0/bin/gem"
        rake:         "/home/admin/.rvm/gems/ruby-1.9.3-p0@rails313/bin/rake"

      environment:
        PATH:         "/home/admin/.rvm/gems/ruby-1.9.3-p0@rails313/bin:/home/admin/.rvm/gems/ruby-1.9.3-p0@global/bin:/home/admin/.rvm/rubies/ruby-1.9.3-p0/bin:/home/admin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
        GEM_HOME:     "/home/admin/.rvm/gems/ruby-1.9.3-p0@rails313"
        GEM_PATH:     "/home/admin/.rvm/gems/ruby-1.9.3-p0@rails313:/home/admin/.rvm/gems/ruby-1.9.3-p0@global"
        MY_RUBY_HOME: "/home/admin/.rvm/rubies/ruby-1.9.3-p0"
        IRBRC:        "/home/admin/.rvm/rubies/ruby-1.9.3-p0/.irbrc"
        RUBYOPT:      ""
        gemset:       "rails313"

宝石文件内容

source 'http://rubygems.org'

    gem 'rails'

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

    gem 'sqlite3'

    gem 'jquery-rails','>= 1.0.3'

    gem 'carrierwave'

    gem 'mini_magick'

    gem 'rake'

    gem 'activesupport'

apache.conf中的乘客设置

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

/ etc / apache2 / sites-enabled中的App Config

<VirtualHost 174.143.141.247:81>

      RailsEnv      development
      DocumentRoot /home/admin/rails/bnkpics/public
      <Directory /home/admin/rails/bnkpics/public>
          AllowOverride all
          Options -MultiViews
       </Directory>
      ServerName  174.143.141.247
      NameVirtualHost 174.143.141.247:81

    </VirtualHost>

/etc/apache2/ports.conf的内容

NameVirtualHost *:80
    Listen 80
    Listen 81
    # Listen 82
    # Listen 83

    <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 abstract (1.0.0) 
    Using activesupport (3.0.7) 
    Using builder (2.1.2) 
    Using i18n (0.5.0) 
    Using activemodel (3.0.7) 
    Using erubis (2.6.6) 
    Using rack (1.2.4) 
    Using rack-mount (0.6.14) 
    Using rack-test (0.5.7) 
    Using tzinfo (0.3.31) 
    Using actionpack (3.0.7) 
    Using mime-types (1.17.2) 
    Using polyglot (0.3.3) 
    Using treetop (1.4.10) 
    Using mail (2.2.19) 
    Using actionmailer (3.0.7) 
    Using arel (2.0.10) 
    Using activerecord (3.0.7) 
    Using activeresource (3.0.7) 
    Using bundler (1.0.21) 
    Using carrierwave (0.5.8) 
    Using thor (0.14.6) 
    Using railties (3.0.7) 
    Using jquery-rails (1.0.19) 
    Using subexec (0.1.0) 
    Using mini_magick (3.3) 
    Using rails (3.0.7) 
    Using sqlite3 (1.3.5) 
    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

我尽可能地包括在这一点上,我不知道去哪里去狩猎.任何人都可以看到我失踪了吗?我仍然是使用rvm和Rails 3.1.3的新手,所以我确信这很简单.我可以提供其他任何帮助解决这个问题的信息吗?我需要一个答案,因为这是一个客户端的应用程序,已经运行了一段时间,但没有被使用,当然,直到我打破了这一天.任何帮助将不胜感激!

解决方法

你没有在Apache配置中使用RVM ruby​​,在你的apache conf你指向旧的系统版本
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
 PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
 PassengerRuby /usr/bin/ruby1.8

您需要使用RVM安装的1.9.3,最简单的方法是再次安装乘客宝石,并查看输出,编译时会给您正确的配置,我的外观类似于:

LoadModule passenger_module /Users/admin/.rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /Users/admin/.rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.9
PassengerRuby /Users/admin/.rvm/wrappers/ruby-1.9.3-p0/ruby
原文链接:https://www.f2er.com/ruby/272683.html

猜你在找的Ruby相关文章