2013-08-16 53 views
-1

下面是它拋出的錯誤。我對此很新,所以仍然在學習排除故障。謝謝您的幫助。Rails S - 退出並不能找出爲什麼

Exiting 
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `load': /Users/silver2002ws6/code/omrails/app/models/model.rb:11: syntax error, unexpected keyword_end (SyntaxError) 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `block in load_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:639:in `new_constants_in' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:468:in `load_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:353:in `require_or_load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:502:in `load_missing_constant' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:192:in `block in const_missing' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `const_missing' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:554:in `get' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:588:in `constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise.rb:278:in `get' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/mapping.rb:77:in `to' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/mapping.rb:72:in `modules' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/mapping.rb:89:in `routes' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/mapping.rb:156:in `default_used_route' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/mapping.rb:66:in `initialize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise.rb:312:in `new' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise.rb:312:in `add_mapping' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/rails/routes.rb:208:in `block in devise_for' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/rails/routes.rb:207:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-3.0.1/lib/devise/rails/routes.rb:207:in `devise_for' 
    from /Users/silver2002ws6/code/omrails/config/routes.rb:4:in `block in <top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `eval_block' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:260:in `draw' 
    from /Users/silver2002ws6/code/omrails/config/routes.rb:1:in `<top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `block in load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `load_paths' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:16:in `reload!' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:26:in `block in updater' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `call' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `execute' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:27:in `updater' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing' 
    from /Users/silver2002ws6/code/omrails/config/environment.rb:5:in `<top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/silver2002ws6/code/omrails/config.ru:3:in `block in <main>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
    from /Users/silver2002ws6/code/omrails/config.ru:in `new' 
    from /Users/silver2002ws6/code/omrails/config.ru:in `<main>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/server.rb:46:in `app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in <top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
Austins-MacBook-Pro:omrails silver2002ws6$ Exiting 
-bash: Exiting: command not found 
Austins-MacBook-Pro:omrails silver2002ws6$ /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `load': /Users/silver2002ws6/code/omrails/app/models/model.rb:11: syntax error, unexpected keyword_end (SyntaxError) 
> from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `block in load_file' 
> from /usr/local/rvm/ 
+2

您在第11行的文件中有一個語法錯誤:/Users/silver2002ws6/code/omrails/app/models/model.rb。 – vee

+1

'/Users/silver2002ws6/code/omrails/app/models/model.rb: 11:語法錯誤,意外的keyword_end(SyntaxError)'<<我認爲這可能是有用的部分:) – 2013-08-16 18:27:25

回答

2
Austins-MacBook-Pro:omrails silver2002ws6$ /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `load': /Users/silver2002ws6/code/omrails/app/models/model.rb:11: syntax error, unexpected keyword_end (SyntaxError) 

看起來你可以在那個文件中有語法錯誤。僅供參考,有一個名爲Model的型號不是一個好主意。考慮一個不同的名字。

這種特殊的語法錯誤,可能是因爲你有一個額外end某處,或缺少一個end,或者是因爲你有一個end但缺少do

如果您發佈您的代碼,我們可以提供更多幫助。

+0

class Model user2690400

+1

@ user2690400您可以編輯您的問題並代之以添加代碼?從評論中閱讀是相當困難的... – 2013-08-16 18:55:16

+0

我得到它的工作...在attr_accessible下我沒有告訴它識別:名稱。我不會試圖解釋它,以免混淆像我這樣的新手可能遇到這個問題。感謝您的幫助! – user2690400

相關問題