Проблема Phusion Passenger: «Приложение Ruby (Rack) не может быть запущено» - PullRequest
1 голос
/ 20 февраля 2011

После создания sudo port install curl-ca-bundle ссылка У меня начались проблемы, но я не знаю, было ли это вызвано curl-ca-bundle.

У меня есть эта проблема:

Ruby (Rack) application could not be started

These are the possible causes:

    *
      There may be a syntax error in the application's code. Please check for such errors and fix them.
    *
      A required library may not installed. Please install all libraries that this application requires.
    *
      The application may not be properly configured. Please check whether all configuration files are written correctly, fix any incorrect configurations, and restart this application.
    *
      A service that the application relies on (such as the database server or the Ferret search engine server) may not have been started. Please start that service.

Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.

Error message:
    uninitialized constant Rack::ResponseTimer
Exception class:
    NameError
Application root:
    /Users/<my_user_name>/Sites/pjtname.com/pjtname.com 

Backtrace:
    #   File    Line    Location
    0   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb    124     in `block in constantize'
    1   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb    123     in `each'
    2   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb    123     in `constantize'
    3   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   14  in `klass'
    4   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   33  in `build'
    5   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   79  in `block in build'
    6   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   79  in `each'
    7   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   79  in `inject'
    8   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/stack.rb   79  in `build'
    9   /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb    162     in `app'
    10  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application/finisher.rb   35  in `block in '
    11  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/initializable.rb  25  in `instance_exec'
    12  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/initializable.rb  25  in `run'
    13  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/initializable.rb  50  in `block in run_initializers'
    14  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/initializable.rb  49  in `each'
    15  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/initializable.rb  49  in `run_initializers'
    16  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb    134     in `initialize!'
    17  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb    77  in `method_missing'
    18  /Users/<my_user_name>/Sites/pjtname.com/pjtname.com/config/environment.rb   5   in `'
    19  config.ru   3   in `require'
    20  config.ru   3   in `block in '
    21  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.2.1/lib/rack/builder.rb     46  in `instance_eval'
    22  /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/rack-1.2.1/lib/rack/builder.rb     46  in `initialize'
    23  config.ru   1   in `new'
    24  config.ru   1   in `'

Итак, в Терминале я попытался запустить

gem update

и все драгоценные камни были обновлены, кроме этого:

Updating text-hyphen
ERROR:  Error installing text-hyphen:
    text-hyphen requires Ruby version < 1.9.

Запуск

which ruby

это приводит к

/Users/<my_user_name>/.rvm/rubies/ruby-1.9.2-p136/bin/ruby

Запуск

ruby -v

это приводит к

ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]

Запуск

gem list

это приводит к

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.4, 3.0.3, 3.0.1)
actionpack (3.0.4, 3.0.3, 3.0.1)
activemodel (3.0.4, 3.0.3, 3.0.1)
activerecord (3.0.4, 3.0.3, 3.0.1)
activeresource (3.0.4, 3.0.3, 3.0.1)
activesupport (3.0.4, 3.0.3, 3.0.1)
always_verify_ssl_certificates (0.2.0)
arel (2.0.8, 2.0.7, 2.0.6, 1.0.1)
bartt-ssl_requirement (1.2.4)
builder (3.0.0, 2.1.2)
bundler (1.0.10, 1.0.7)
daemon_controller (0.2.6, 0.2.5)
erubis (2.6.6)
fastthread (1.0.7)
file-tail (1.0.5)
i18n (0.5.0, 0.4.2)
mail (2.2.15, 2.2.14, 2.2.13, 2.2.10)
memcache-client (1.8.5)
mime-types (1.16)
mysql2 (0.2.6)
paperclip (2.3.8)
passenger (3.0.2)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7, 0.5.6)
rails (3.0.4, 3.0.3, 3.0.1)
railties (3.0.4, 3.0.3, 3.0.1)
rake (0.8.7)
rubygems-update (1.5.2, 1.4.2)
sinatra (1.1.3, 1.1.2)
spruz (0.2.5, 0.2.2)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.14.6)
tilt (1.2.2)
treetop (1.4.9)
tzinfo (0.3.24, 0.3.23)



Перед установкой curl-ca-bundle все работало со следующими утверждениями.


В файле config.ru:

# This file is used by Rack-based servers to start the application.

    require ::File.expand_path('../config/environment',  __FILE__)
    run PjtnameCom::Application

In ROOT_RAILS/conf/application.rb:

module PjtnameCom
  class Application < Rails::Application
    # Configure middlewares
    config.middleware.use "Rack::ResponseTimer"
    ...
  end
end

Обратите внимание : если я удаляю config.middleware.use "Rack::ResponseTimer", это работает.


В ROOT_RAILS/libs/rack/response_timer.rb:

module Rack
  class ResponseTimer
    def initialize(app)
      @app = app
    end

    def call(env)
      status, headers, response = @app.call(env)
      [status, headers, response]
    end
  end
end

Что это за ошибка? Как я могу решить эту проблему? Я должен переустановить Phusion Passenger?

Я использую:

  • Mac OS под управлением "Снежный барс" 10.6.6

  • Ruby Version Manager (RVM)

  • Apache

  • Ruby on Rails v3.0.3 ( возможно, мне нужно обновить систему до версии 3.0.4? )

P.S. : Если вам нужна другая информация, дайте мне знать.

1 Ответ

1 голос
/ 20 февраля 2011

решено


В RAILS_ROOT/config/application.rb Я забыл (!!!!!)

# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
config.autoload_paths += %W(#{config.root}/lib)
...