gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 06:38:08 24 4
gpt4 key购买 nike

我最近将我的 Rails 设置升级到 3.1.3,我在 Phusion Passenger 在此服务器上加载旧应用程序时遇到问题。我在测试应用程序上运行了所有东西,但我仍然对这个应用程序有问题。当我在端口 3000 上运行 Webrick 服务器时,我的应用程序运行完美,但是当我试图通过虚拟主机访问它时,我继续收到 Passenger 错误。这是信息:

乘客抛出错误

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

错误信息:

无法在任何来源中找到 activesupport-3.0.7 (Bundler::GemNotFound)

异常类:

PhusionPassenger::UnknownError

应用根目录:

/home/admin/rails/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云服务器)

  • 经销商 ID:Ubuntu
  • 描述:Ubuntu 10.04.3 LTS
  • 版本:10.04
  • 代号:清醒

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 by 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/passenger

gem 列表结果

    *** 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)

bundle列表结果

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"

gem 文件内容

    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 中的应用程序配置

    <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>

bundle列表结果

    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,最简单的方法是再次安装 passenger gem 并查看输出,当它编译时它会给您正确的 conf,我的看起来像这样:

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

关于ruby-on-rails - Phusion Passenger 在使用 rvm 升级 Ruby 和 Rails 后抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8390604/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com