0

当我尝试运行我的 rails 服务器时,我收到以下错误(重要提示:我刚刚将我的代码从 Github 拉到 Nitrous.Io,并开始在应用程序上工作):

/home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get': uninitialized constant User (NameEr
ror)                                                                                                                                                                    from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'             
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'                             
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'                           
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'                      
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:285:in `get'                                                               
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:77:in `to'                                                         
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:72:in `modules'                                                    
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:89:in `routes'                                                     
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:156:in `default_used_route'                                        
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:66:in `initialize'                                                 
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:319:in `new'                                                               
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:319:in `add_mapping'                                                       
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:210:in `block in devise_for'                                  
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:209:in `each'                                                 
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:209:in `devise_for'                                           
        from /home/action/pinteresting/config/routes.rb:4:in `block in <top (required)>'                                                                       
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'                      
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'                         
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'                               
        from /home/action/pinteresting/config/routes.rb:1:in `<top (required)>'  
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'                   
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'                                  
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'                            
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'                               
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'                      
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'                            
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'                         
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'                               
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'                     
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'                   
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'                                       
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'                                                 
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'                           
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'                                                     
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'                   
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'                                  
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'                              
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'                                                                    
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'                                       
        from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'       
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'                                    
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'                                          
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'                               
        from /home/action/pinteresting/config/environment.rb:5:in `<top (required)>'                                                                           
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'                                 
        from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:45:in `<top (required)>'                                         
        from bin/rails:4:in `require'                                                                                                                          
        from bin/rails:4:in `<main>'
4

1 回答 1

1

看起来您的数据库尚未创建。

如果您使用的是 sqlite,最可能的解决方案是运行rake db:migrate,但如果您在 Nitrous 上使用 Postgres 或 Mysql,则需要先安装它们。这里有一个可用的指南http://help.nitrous.io/categories/databases/

于 2013-11-17T23:59:02.997 回答