Chromedriver / Capybara Too many open files - socket(2) for "127.0.0.1" port 9518 - selenium-chromedriver

I'm getting this error (details below) when a capybara selector is malformed or can't find. Why is it happening, and how can I prevent the error?
This is new, I think, since our recent upgrade to the latest driver.
The command that triggers this:
find('.panel.#synopsis .btn', text: /new email/i)
Before such an error sudo lsof -i :9518 returns 6 items, after there seem to be hundreds of these.
Error:
Failure/Error: TCPSocket.open(conn_addr, conn_port, #local_host, #local_port)
Errno::EMFILE:
Failed to open TCP connection to 127.0.0.1:9518 (Too many open files - socket(2) for "127.0.0.1" port 9518)
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:960:in `initialize'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:960:in `open'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/timeout.rb:78:in `timeout'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:958:in `connect'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/webmock-3.7.6/lib/webmock/http_lib_adapters/net_http.rb:136:in `start_with_connect_without_finish'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/webmock-3.7.6/lib/webmock/http_lib_adapters/net_http.rb:104:in `request'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:129:in `response_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:82:in `request'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/common.rb:64:in `call'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/bridge.rb:167:in `execute'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:567:in `execute'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/w3c/bridge.rb:173:in `window_handles'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/common/driver.rb:187:in `window_handles'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara/selenium/driver.rb:208:in `window_handles'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara/selenium/driver_specializations/chrome_driver.rb:43:in `reset!'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara/session.rb:130:in `reset!'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara.rb:322:in `block in reset_sessions!'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara.rb:322:in `reverse_each'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara.rb:322:in `reset_sessions!'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capybara-3.30.0/lib/capybara/rspec.rb:18:in `block (2 levels) in <top (required)>'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:363:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:515:in `block in run_owned_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:514:in `each'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:514:in `run_owned_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:601:in `block in run_example_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:600:in `each'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:600:in `run_example_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:471:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:510:in `run_after_example'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:276:in `block in run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:472:in `block in run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:612:in `block in run_around_example_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-rails-3.9.0/lib/rspec/rails/adapters.rb:127:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:381:in `execute_with'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:614:in `block (2 levels) in run_around_example_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:615:in `run_around_example_hooks_for'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:472:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:460:in `with_around_example_hooks'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:254:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:633:in `block in run_examples'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:629:in `map'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:629:in `run_examples'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:595:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `block in run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `map'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `block in run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `map'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `map'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:116:in `block in run_specs'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:74:in `report'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:115:in `run_specs'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:89:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:71:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:45:in `invoke'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-core-3.9.1/exe/rspec:4:in `<top (required)>'
# /Users/myuser/.rbenv/versions/2.7.0/bin/rspec:23:in `load'
# /Users/myuser/.rbenv/versions/2.7.0/bin/rspec:23:in `<top (required)>'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `load'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli/exec.rb:28:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli.rb:476:in `exec'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli.rb:30:in `dispatch'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/cli.rb:24:in `start'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/libexec/bundle:46:in `block in <top (required)>'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/bundler/friendly_errors.rb:123:in `with_friendly_errors'
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bundler-2.1.2/libexec/bundle:34:in `<top (required)>'
# /Users/myuser/.rbenv/versions/2.7.0/bin/bundle:23:in `load'
# /Users/myuser/.rbenv/versions/2.7.0/bin/bundle:23:in `<main>'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
# ------------------
# --- Caused by: ---
# Errno::EMFILE:
# Too many open files - socket(2) for "127.0.0.1" port 9518
# /Users/myuser/.rbenv/versions/2.7.0/lib/ruby/2.7.0/net/http.rb:960:in `initialize'

If you're using WebMock in your specs, then add the following to your rails_helper.rb:
WebMock.allow_net_connect!(net_http_connect_on_start: true)
or
WebMock.disable_net_connect!(net_http_connect_on_start: true)
source: https://github.com/bblimke/webmock/blob/master/README.md#connecting-on-nethttpstart

I have been getting the same error messages with Capybara feature specs since upgrading to ruby 2.7, and it has nothing to do with open files, per se. When Capybara misses a selector (in your case, probably find('.panel.#synopsis .btn', text: /new email/i)), it throws a socket(2) too many files error.
Edit: I had a Webmock call that seemed to be opening all the files (in other words: yeah, you get too many files open - socket(2) when something can’t be found ... but while Capybara was looking for the thing that couldn’t be found, Webmock was running amok).
Here’s the link: https://github.com/bblimke/webmock/blob/master/README.md#connecting-on-nethttpstart, which is a piggyback off of Pepa’s response below (it’s a reference inside the Capybara 'gotchas').

ulimit -Sn 10240 did the trick for me
-S Set a soft limit for the given resource.
-n The maximum number of open file descriptors.

You need to increase limit of file descriptors that are allowed to be open.
The simplest approach to do that is to add a line ulimit -n 65536 to your ~/.bash_profile or ~/.zshrc. That line will set ulimit to 65536 for new sessions.

an alternative solution would be cleaning tmp/cache
a computer restart may help as well

In my case, I was missing the id set in the HTML. Adding the id fixed it immediately.

Related

I can't seem to get rails server to run

I'm trying to make my first rails application, however when i try to run rails server however it just gives me a load of text. I'm running this on arch linux and used the ruby-rails bundle from the AUR.
this is what it gives me when it try to run the command
[drew#rhino sophia]$ rails server
=> Booting Puma
=> Rails 5.2.0 application starting in development
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
70: from bin/rails:3:in `<main>'
69: from bin/rails:3:in `load'
68: from /home/drew/work/spproject/sophia/sophia/bin/spring:15:in `<top (required)>'
67: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
66: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
65: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
64: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
63: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
62: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
61: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
60: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
59: from /usr/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
58: from /home/drew/work/spproject/sophia/sophia/bin/rails:9:in `<top (required)>'
57: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
56: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
55: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
54: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
53: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
52: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
51: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
50: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
49: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
48: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
47: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
46: from /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
45: from /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
44: from /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
43: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
42: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
41: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
40: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:51:in `start'
39: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
38: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:354:in `wrapped_app'
37: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:27:in `app'
36: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:219:in `app'
35: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:319:in `build_app_and_options_from_config'
34: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in `parse_file'
33: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `new_from_string'
32: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `eval'
31: from config.ru:in `<main>'
30: from config.ru:in `new'
29: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
28: from /usr/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
27: from config.ru:3:in `block in <main>'
26: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
25: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
24: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
23: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
22: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
21: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
20: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
19: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
18: from /usr/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
17: from /home/drew/work/spproject/sophia/sophia/config/environment.rb:5:in `<main>'
16: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
15: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
14: from /usr/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
13: from /usr/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
12: from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
11: from /usr/lib/ruby/2.5.0/tsort.rb:347:in `call'
10: from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each'
9: from /usr/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
8: from /usr/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
7: from /usr/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
6: from /usr/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
5: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
4: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
3: from /home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
2: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/railtie.rb:42:in `block in <class:Railtie>'
1: from /usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/core_ext/time/zones.rb:82:in `find_zone!'
/usr/lib/ruby/gems/2.5.0/gems/activesupport-5.2.0/lib/active_support/core_ext/time/zones.rb:100:in `rescue in find_zone!': Invalid Timezone: UTC (ArgumentError)
EDIT gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.7
- RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/2.5.0
- USER INSTALLATION DIRECTORY: /home/drew/.gem/ruby/2.5.0
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- SPEC CACHE DIRECTORY: /home/drew/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/2.5.0
- /home/drew/.gem/ruby/2.5.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--user-install"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/bin
- /bin
- /usr/local/sbin
- /usr/lib/jvm/default/bin
- /usr/bin/site_perl
- /usr/bin/vendor_perl
- /usr/bin/core_perl
Paste of $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Paste of application.rb
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Sophia
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
end
end
Paster of rails migrate:db
rails aborted!
ArgumentError: Invalid Timezone: UTC
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/home/drew/work/spproject/sophia/sophia/config/environment.rb:5:in `<main>'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:48:in `invoke'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
/home/drew/work/spproject/sophia/sophia/bin/rails:9:in `<top (required)>'
/home/drew/work/spproject/sophia/sophia/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
TZInfo::InvalidTimezoneIdentifier: Expected 44 bytes reading '/usr/share/zoneinfo/UTC', but got 0 bytes
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_data_source.rb:205:in `rescue in load_timezone_info'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_data_source.rb:202:in `load_timezone_info'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone.rb:92:in `get'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/home/drew/work/spproject/sophia/sophia/config/environment.rb:5:in `<main>'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:48:in `invoke'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
/home/drew/work/spproject/sophia/sophia/bin/rails:9:in `<top (required)>'
/home/drew/work/spproject/sophia/sophia/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
TZInfo::InvalidZoneinfoFile: Expected 44 bytes reading '/usr/share/zoneinfo/UTC', but got 0 bytes
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb:53:in `check_read'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb:169:in `parse'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb:28:in `block in initialize'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb:27:in `open'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb:27:in `initialize'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_data_source.rb:203:in `new'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_data_source.rb:203:in `load_timezone_info'
/home/drew/.gem/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone.rb:92:in `get'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/home/drew/work/spproject/sophia/sophia/config/environment.rb:5:in `<main>'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:48:in `invoke'
/home/drew/.gem/ruby/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
/home/drew/work/spproject/sophia/sophia/bin/rails:9:in `<top (required)>'
/home/drew/work/spproject/sophia/sophia/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
See at config/application.rb the config.time_zone section.
You could run rake -D time to show all timezone available.
You may have a migration pending. Try running:
rails db:migrate
Add a time_zone to your config file,
config.time_zone = 'Australia/Melbourne'
You can change it to be whatever timezone your application will be in, you can also do
config.time_zone = 'UTC'
Experienced the same problem, showed that my teammate had changed the config/master.key code. Once updated, things went to normal again.

Jekyll buid fails using grunt-responsive-images

HI this is the terminal output when I run jekyll build
Configuration file: /Users/makingthings/Dropbox/Sites/jekyll-uh/_config.yml
/usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- jekyll-responsive_image (LoadError)
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `block in require_gems'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `require_gems'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:19:in `conscientious_require'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `new'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `process'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Possibly conflicting ruby environments?
Not so familiar with ruby but I got this working with config like this:
gems: [jekyll/responsive_image]

Rails s causing psych error

When I run rails s I get the following error message. I have tried replacing all spaces with tabs and vice versa, but am unable to come to a solution.
The console output is here:
SEEMAs-Mac-mini:colloquy_new seemashenoy$ rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/seemashenoy/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 18 column 1 (Psych::SyntaxError)
from /Users/seemashenoy/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/seemashenoy/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/seemashenoy/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/application/configuration.rb:115:in `database_configuration'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `each'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/seemashenoy/Desktop/arjun/colloquy_new/config/environment.rb:5:in `<top (required)>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/seemashenoy/Desktop/arjun/colloquy_new/config.ru:3:in `block in <main>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/seemashenoy/Desktop/arjun/colloquy_new/config.ru:in `new'
from /Users/seemashenoy/Desktop/arjun/colloquy_new/config.ru:in `<main>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/seemashenoy/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
And my database.yml file is below
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: colloquy_development
pool: 5
username: root
password:
socket: /Applications/MAMP/tmp/mysql/mysql.sock

How to resolve error regarding on MySQL in ROR

Can anybody help me to solve the following error ?When i typed rake db:create on cmd i got these errors.
Error:
rake aborted!
NoMethodError: undefined method `each' for #<String:0x1a1af20>
Tasks: TOP => db:create => db:load_config
(See full trace by running task with --trace)
When i run rake db:create --trace i got the following traces.
rake aborted!
NoMethodError: undefined method `each' for #
Tasks: TOP => db:create => db:load_config
(See full trace by running task with --trace)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
rake aborted!
NoMethodError: undefined method `each' for #<String:0x1a37888>
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connect
ion_adapters/connection_specification.rb:150:in `resolve_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connect
ion_handling.rb:69:in `resolve'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/core.rb
:46:in `configurations='
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/railtie
s/databases.rake:5:in `block (2 levels) in <top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `block i
n execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute
'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:179:in `block i
n invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_
with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:201:in `block i
n invoke_prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_
prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:178:in `block i
n invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_
with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:150:in `
invoke_task'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
block (2 levels) in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
block in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:115:in `
run_with_threads'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:100:in `
top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:78:in `b
lock in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `
standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `r
un'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/bin/rake:33:in `<top (required)>
'
C:/Ruby193/bin/rake:23:in `load'
C:/Ruby193/bin/rake:23:in `<main>'
Tasks: TOP => db:create => db:load_config
My database.yml file is described below.
default:&default
adapter:mysql2
encoding:utf8
pool:5
username:root
password:pass
host:localhost
development:<<:*default
database:sqlbook_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:<<:*default
database:sqlbook_test
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="mysql2://myuser:mypass#localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:<<:*default
database:sqlbook_production
username:sqlbook
password:pass
I am using rails version 4.2.0 and ruby 1.9.3.Please help me to resolve this error.Thanks in advance..

Failed to save snapshot by rhc

every time I run rhc snapshot save wp1 got this
Pulling down a snapshot to wp1.tar.gz...
Saving snapshot for secondary mysql-5.5 gear
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift- origin-node/model/v2_cart_model.rb:1313:in `block in do_control_with_directory': CLIENT_ERROR: Failed to execute: 'control pre-snapshot' for /var/lib/openshift/5322d44ce0b8cd3bbd0001cb/mysql (OpenShift::Runtime::Utils::ShellExecutionException)
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1114:in `process_cartridges'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1276:in `do_control_with_directory'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1136:in `do_control'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:68:in `block in snapshot'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:80:in `block in each_cartridge'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1120:in `block in process_cartridges'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1118:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:1118:in `process_cartridges'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/v2_cart_model.rb:78:in `each_cartridge'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:67:in `snapshot'
from /usr/bin/gear:569:in `block (2 levels) in '
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander
/import.rb:10:in `block in '
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/utils/shell_exec.rb:133:in `block (2 levels) in oo_spawn': Shell command '/usr/bin/ssh -q -o 'BatchMode=yes' -o 'StrictHostKeyChecking=no' -i
$OPENSHIFT_APP_SSH_KEY 5322d44ce0b8cd3bbd0001cb#5322d44ce0b8cd3bbd0001cb-wpis.rhcloud.com 'snapshot' > mysql-5.5.tar.gz' returned an error. rc=1 (OpenShift::Runtime::Utils::ShellExecutionException)
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/utils/shell_exec.rb:96:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/utils/shell_exec.rb:96:in `block in oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/utils/shell_exec.rb:95:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/utils/shell_exec.rb:95:in `oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.7.1/lib/openshift/runtime/containerization/selinux_container.rb:339:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container.rb:764:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:104:in `block in handle_scalable_snapshot'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:100:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:100:in `handle_scalable_snapshot'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.6/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:58:in `snapshot'
from /usr/bin/gear:569:in `block (2 levels) in '
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/import.rb:10:in `block in '
Error in trying to save snapshot. You can try to save manually by running:
ssh ce2cf000931#wp1-wpis.rhcloud.com 'snapshot' > wp1.tar.gz
I try to restart my application,but not work.
ruby verison 2.0.0p247 (2013-06-27) [x86_64-linux]
rhc 1.21.3
am I doing something wrong?
``````
Please file a bug report with the above details here: https://bugzilla.redhat.com/enter_bug.cgi?product=OpenShift%20Online