开发者

Phusion Passenger problem: "Ruby (Rack) application could not be started"

After made sudo port install curl-ca-bundle link I started to have problems, but I don't know if it was caused from curl-ca-bundle.

I have this problem:

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

So, in the Terminal I tryed to 开发者_如何学编程run

gem update

and all gems was updated, except this:

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

Running

which ruby

it results in

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

Running

ruby -v

it results in

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

Running

gem list

it results in

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



Before installing curl-ca-bundle all worked with the following statements.


In the config.ru file:

# 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

Notice: if I delete config.middleware.use "Rack::ResponseTimer" it works.


In 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

What is that error? How can I solve that? I have to re-install Phusion Passenger?

I use:

  • Mac Os running "Snow Leopard" 10.6.6

  • Ruby Version Manager (RVM)

  • Apache

  • Ruby on Rails v3.0.3 (maybe I have to upgrade to v 3.0.4?)

P.S.: If you need some other information, let me know.


SOLVED


In RAILS_ROOT/config/application.rb I had forgotten (!!!!!)

# 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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜