我尝试使用Cloud9启动我的rails服务器并收到以下消息:
弃用警告:配置选项
config.serve_static_assets
已重命名为config.serve_static_files
以阐明其角色(它仅支持提供public
文件夹中的所有内容,并且与资产管道无关)。在Rails 5.0中将删除serve_static_assets
别名。请相应地迁移配置文件。 (来自/home/ubuntu/workspace/config/application.rb:25) =>启动WEBrick => Rails 4.2.5应用程序从http://0.0.0.0:8080开发开始 =>运行rails server -h
以获取更多启动选项 => Ctrl-C关闭服务器 退出 /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:177:inrescue in spec': Specified 'postgresql' for database adapter, but the gem is not loaded. Add
gem' pg'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
符合规范' 来自/usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:50:inestablish_connection' from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-4.2.5/lib/active_record/railtie.rb:120:in
块(2级)' 来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:38:ininstance_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' 来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:45:inblock 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
每个' 来自/usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:44:inrun_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:inblock 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:innew_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:inrequire' 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:inload' 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:innew_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:inrequire_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:inconst_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:inblock 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:ininject' 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:inget' 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:inget' 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:inmodules' 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:indefault_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:innew' 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:inblock 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:indevise_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:ininstance_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:indraw' 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:inload' 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:inload_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:inblock 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:inload_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:inblock 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:inupdater' 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:inblock 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:inrun' 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:inblock 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:ineach_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:ineach' 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:ineach_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:intsort_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:ininitialize!' 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:inrequire' 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:inload_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:inblock 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:ininitialize' 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:innew_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:inbuild_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:inapp' 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:inlog_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:inblock 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:inserver' 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:incall' 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:inrun' 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:inload' 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而没有运气。
答案 0 :(得分:0)
尝试以下操作,编辑您的Gemfile,如下所示
gem 'pg', '~> 0.20.0'
或者
gem 'pg', '~> 0.11'
然后捆绑安装并尝试,它正在我手上。
希望有所帮助