无法启动Rails服务器 - DEPRECATION ERROR

时间:2018-03-11 16:41:23

标签: ruby-on-rails ruby

我尝试使用Cloud9启动我的rails服务器并收到以下消息:

  

弃用警告:配置选项config.serve_static_assets已重命名为config.serve_static_files以阐明其角色(它仅支持提供public文件夹中的所有内容,并且与资产管道无关)。在Rails 5.0中将删除serve_static_assets别名。请相应地迁移配置文件。 (来自/home/ubuntu/workspace/config/application.rb:25)   =&GT;启动WEBrick   =&GT; Rails 4.2.5应用程序从http://0.0.0.0:8080开发开始   =&GT;运行rails server -h以获取更多启动选项   =&GT; Ctrl-C关闭服务器   退出   /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:177:in rescue in spec': Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem&#39; pg&#39; to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError) from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:174:in符合规范&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:50:in establish_connection' from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/railtie.rb:120:in块(2级)&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:38:in execute_hook&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:44:in每个&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks' from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/base.rb:315:in&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/base.rb:26:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in要求&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in block in require' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:238:in块中的load_dependency&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in new_constants_in' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:238:in load_dependency&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' from /home/ubuntu/workspace/app/models/podcast.rb:1:in&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in load' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in块中的load_file&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in new_constants_in' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in load_file&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in require_or_load' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:494:in load_missing_constant&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:184:in const_missing' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in const_get&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in block in constantize' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in每个&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in inject' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in constantize&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:566:in get' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:597:in constantize&#39;           从/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise.rb:315:in get' from /usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/mapping.rb:83:in到&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/mapping.rb:78:in modules' from /usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/mapping.rb:95:in路线&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/mapping.rb:162:in default_used_route' from /usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/mapping.rb:72:in初始化&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise.rb:345:in new' from /usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise.rb:345:in add_mapping&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/rails/routes.rb:243:in block in devise_for' from /usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/rails/routes.rb:242:in每个&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/devise-4.4.1/lib/devise/rails/routes.rb:242:in devise_for' from /home/ubuntu/workspace/config/routes.rb:7:in阻止&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in instance_exec' from /usr/local/rvm/gems/ruby-2.3.4/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in eval_block&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:412:in draw' from /home/ubuntu/workspace/config/routes.rb:1:in&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in阻止加载&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in load_dependency' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in loading&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in block in load_paths' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in每个&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in load_paths' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:16:in重新加载!&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:26:in block in updater' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/file_update_checker.rb:75:in执行&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:27:in updater' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:7:in execute_if_updated&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application/finisher.rb:69:in block in <module:Finisher>' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/initializable.rb:30:in instance_exec&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/initializable.rb:30:in run' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/initializable.rb:55:in阻止run_initializers&#39;           来自/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in块(2级)in each_strongly_connected_component&#39;           来自/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in each_strongly_connected_component_from' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in块中的each_strongly_connected_component&#39;           来自/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in each' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in来电&#39;           来自/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component' from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in tsort_each&#39;           来自/usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in tsort_each' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/initializable.rb:54:in run_initializers&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/application.rb:352:in initialize!' from /home/ubuntu/workspace/config/environment.rb:5:in&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in块中的要求&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in load_dependency' from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in要求&#39;           来自/home/ubuntu/workspace/config.ru:3:in block in <main>' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/builder.rb:55:in instance_eval&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/builder.rb:55:in initialize' from /home/ubuntu/workspace/config.ru:in new&#39;           来自/home/ubuntu/workspace/config.ru:in <main>' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/builder.rb:49:in eval&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/builder.rb:49:in new_from_string' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/builder.rb:40:in parse_file&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/server.rb:300:in build_app_and_options_from_config' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/server.rb:209:in app&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:61:in app' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.9/lib/rack/server.rb:337:in wrapped_app&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:139:in log_to_stdout' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:78:in start&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in block in server' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in点击&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in server' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in run_command!&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands.rb:17:in <top (required)>' from /home/ubuntu/workspace/bin/rails:9:in要求&#39;           from / home / ubuntu / workspace / bin / rails:9:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/command.rb:7:in来电&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client.rb:30:in run' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/bin/spring:49:in&#39;           来自/usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/binstub.rb:31:in&#39;           来自/ home / ubuntu / workspace / bin / spring:15:require' from /home/ubuntu/workspace/bin/spring:15:in&#39;           来自bin / rails:3:load' from bin/rails:3:in&#39;

流程退出代码:1

有关如何解决问题的任何想法?我多次运行Bundle Update而没有运气。

1 个答案:

答案 0 :(得分:0)

尝试以下操作,编辑您的Gemfile,如下所示

gem 'pg', '~> 0.20.0'

或者

gem 'pg', '~> 0.11'

然后捆绑安装并尝试,它正在我手上。

希望有所帮助