我有一个问题,即Foreman几天前正在正常运行。昨天我对所有系统进行了全面升级,所以我不知道这是否会导致问题。 无论如何,我无法追溯问题。 为了解决这个问题,我更新了所有宝石,卸载并重新安装了myslq2 gem,但没有任何改变。
我粘贴了Foreman输出
luca@luca-X200MA:~/cmonrails/cmonrails$ foreman start
10:46:36 web.1 | started with pid 6863
10:46:36 memcached.1 | started with pid 6864
10:46:40 web.1 | warning: parser/current is loading parser/ruby21, which recognizes
10:46:40 web.1 | warning: 2.1.7-compliant syntax, but you are running 2.1.2.
10:46:40 web.1 | warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
10:46:42 web.1 | => Booting WEBrick
10:46:42 web.1 | => Rails 4.2.3 application starting in development on http://0.0.0.0:3000
10:46:42 web.1 | => Run `rails server -h` for more startup options
10:46:42 web.1 | => Ctrl-C to shutdown server
10:46:42 web.1 | Exiting
10:46:42 web.1 | /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:50:in `establish_connection'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:Railtie>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/base.rb:26:in `<top (required)>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:73:in `block in <class:EnvironmentReport>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:99:in `call'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:99:in `block in initialize'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `inject'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/environment_report.rb:97:in `initialize'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:799:in `new'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:799:in `environment_for_connect'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:790:in `generate_environment_report'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:491:in `setup_and_start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:479:in `check_config_and_start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/agent.rb:547:in `start'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/control/instance_methods.rb:112:in `start_agent'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/new_relic/control/instance_methods.rb:72:in `init_plugin'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/newrelic_rpm-3.14.0.305/lib/newrelic_rpm.rb:41:in `block in <class:Railtie>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `call'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
10:46:42 web.1 | from /usr/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config/environment.rb:5:in `<top (required)>'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:3:in `require'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:3:in `block in <main>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:in `new'
10:46:42 web.1 | from /home/luca/cmonrails/cmonrails/config.ru:in `<main>'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:139:in `log_to_stdout'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/server.rb:78:in `start'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
10:46:42 web.1 | from /var/lib/gems/2.1.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
10:46:42 web.1 | from bin/rails:8:in `require'
10:46:42 web.1 | from bin/rails:8:in `<main>'
10:46:42 web.1 | exited with code 1
10:46:42 system | sending SIGTERM to all processes
10:46:42 memcached.1 | terminated by SIGTERM
答案 0 :(得分:1)
我经常看到这一点 - 似乎最新的mysql2 gem存在问题。您应该尝试指定以前工作的版本。我个人发现0.3.20解决了这个问题。所以只需用:
更新你的Gemfilegem 'mysql2', '0.3.20'
希望能解决它。
我唯一的假设是主要的mysql2 gem有一些变化来支持Rails 5?