1

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

感谢您的任何帮助。这是我正在运行的内容:

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

1 回答 1

0

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

于 2013-03-18T13:15:53.757 回答