Rails应用程序无法正常启动 - 不确定原因

时间:2013-03-16 22:13:47

标签: ruby-on-rails-3

我在DreamHost.com上运行了个人rails应用程序。它运行良好,但我在几周内没有使用它。现在,当我访问该网站时,我收到消息“Rails应用程序无法正常启动”。我ssh到我的帐户并尝试从终端运行命令。我试图在生产模式下进入控制台,我尝试运行'rake routes'。对于两者,我得到以下输出。我认为这是一个路线问题,但我真的不确定。我希望有人能更多地进入轨道,而不是我可以判断问题是否报告给我以及它是什么。

感谢您的帮助。 这是我正在运行的:

[coneflower]$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
[coneflower]$ gem -v
1.8.25
[coneflower]$ rails -v
Rails 3.2.2

错误输出:

[coneflower]$ rake routes
rake aborted!
missing :action
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:183:in `default_controller_and_action'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:59:in `initialize'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `new'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `add_route'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `block in match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:258:in `root'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1315:in `root'
/home/johndcow/rails/drywall/releases/20130306000519/config/routes.rb:2:in `block in <top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `eval_block'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:254:in `draw'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `block in load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties- 3.2.2/lib/rails/application/routes_reloader.rb:40:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `call'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `execute'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/johndcow/rails/drywall/releases/20130306000519/config/environment.rb:5:in `<top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)
[coneflower]$ 

路线档案:

Drywall::Application.routes.draw do
  resources :access, :only => :index  
  resources :users, :only => [:index, :new] 
  resources :payments
  resources :materials
  resources :hours
  resources :jobs 
  resources :customer 
  resources :reports, :only => :index do
    collection do
      get :statement
    end
  end

  # I removed the commented out examples here
  #
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.

  match ':controller(/:action(/:id))(.:format)'
end

1 个答案:

答案 0 :(得分:0)

resources :access可能导致问题。众所周知,在产品的耙子中打破多元化。模式。见http://bparanj.blogspot.no/2011/07/reserved-words-in-rails.html