Jekyll Serve argument error "Option name hard_wrap is already used" - jekyll

When I try and run bundle exec jekyll serve, I get the error:
Conversion error: Jekyll::Converters::Markdown encountered an error while converting. Option name hard_wrap is already used.
/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/kramdown-2.3.0/lib/kramdown/options.rb:52:in `define': Option name hard_wrap is already used (ArgumentError)
Generating...
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_posts/lunch-and-learn.markdown':
Option name hard_wrap is already used
Traceback (most recent call last):
46: from /Users/adam/.rbenv/versions/2.7.2/bin/jekyll:23:in `<main>'
45: from /Users/adam/.rbenv/versions/2.7.2/bin/jekyll:23:in `load'
44: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
43: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
42: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
41: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
40: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
39: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
38: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
37: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
36: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
35: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
34: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in `process'
33: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in `build'
32: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in `process_site'
31: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:71:in `process'
30: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:191:in `render'
29: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:462:in `render_docs'
28: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:462:in `each_value'
27: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:463:in `block in render_docs'
26: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:463:in `each'
25: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:464:in `block (2 levels) in render_docs'
24: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:479:in `render_regenerated'
23: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:62:in `run'
22: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:83:in `render_document'
21: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in `convert'
20: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in `reduce'
19: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in `each'
18: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:101:in `block in convert'
17: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown.rb:76:in `convert'
16: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown.rb:12:in `setup'
15: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown.rb:34:in `get_processor'
14: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown.rb:34:in `new'
13: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown/kramdown_parser.rb:21:in `initialize'
12: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/converters/markdown/kramdown_parser.rb:57:in `load_dependencies'
11: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/external.rb:55:in `require_with_graceful_fail'
10: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/external.rb:55:in `each'
9: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/external.rb:58:in `block in require_with_graceful_fail'
8: from /Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/jekyll-3.9.0/lib/jekyll/external.rb:58:in `require'
7: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown-parser-gfm.rb:10:in `<top (required)>'
6: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown-parser-gfm.rb:10:in `require_relative'
5: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm.rb:13:in `<top (required)>'
4: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm.rb:13:in `require_relative'
3: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm/options.rb:10:in `<top (required)>'
2: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm/options.rb:11:in `<module:Kramdown>'
1: from /Users/adam/.gem/ruby/2.7.0/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm/options.rb:13:in `<module:Options>'
/Users/adam/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/kramdown-2.3.0/lib/kramdown/options.rb:52:in `define': Option name hard_wrap is already used (ArgumentError)
I'm on version 3.9.0 of Jekyll and I have kramdown-parser-gfm in my gemfile.
Any help is greatly appreciated.

Related

cannot load such file -- 2.6/ffi_c && cannot load such file -- ffi_c (LoadError)

I'm a beginner with Jekyll, and I saw there were a lot of questions about this problem but the solution given doesn't fit with my problem, so if someone can help me please? It's been a while I'm on it.
This is the message I get after running jekyll serve --port:
Source: /home/a__/repos/Bxgxaxdx.github.io
Destination: /home/a__/repos/Bxgxaxdx.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.029 seconds.
Traceback (most recent call last):
32: from /usr/bin/jekyll:11:in `<main>'
31: from /usr/lib/ruby/vendor_ruby/mercenary.rb:19:in `program'
30: from /usr/lib/ruby/vendor_ruby/mercenary/program.rb:42:in `go'
29: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `execute'
28: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `each'
27: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `block in execute'
26: from /usr/lib/ruby/vendor_ruby/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
25: from /usr/lib/ruby/vendor_ruby/jekyll/commands/build.rb:39:in `process'
24: from /usr/lib/ruby/vendor_ruby/jekyll/commands/build.rb:72:in `watch'
23: from /usr/lib/ruby/vendor_ruby/jekyll/watcher.rb:10:in `watch'
22: from /usr/lib/ruby/vendor_ruby/listen/listener.rb:91:in `start'
21: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:57:in `transition'
20: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:91:in `transition_with_callbacks!'
19: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:121:in `call'
18: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:121:in `instance_eval'
17: from /usr/lib/ruby/vendor_ruby/listen/listener.rb:68:in `block in <class:Listener>'
16: from /usr/lib/ruby/2.6.0/forwardable.rb:230:in `start'
15: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:63:in `start'
14: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:40:in `configure'
13: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:40:in `each'
12: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:45:in `block in configure'
11: from /usr/lib/ruby/vendor_ruby/listen/adapter/linux.rb:30:in `_configure'
10: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
9: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
8: from /usr/lib/ruby/vendor_ruby/rb-inotify.rb:1:in `<top (required)>'
7: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
5: from /usr/lib/ruby/vendor_ruby/rb-inotify/native.rb:1:in `<top (required)>'
4: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2: from /usr/lib/ruby/vendor_ruby/ffi.rb:4:in `<top (required)>'
1: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': **cannot load such file -- 2.6/ffi_c (LoadError)**
33: from /usr/bin/jekyll:11:in `<main>'
32: from /usr/lib/ruby/vendor_ruby/mercenary.rb:19:in `program'
31: from /usr/lib/ruby/vendor_ruby/mercenary/program.rb:42:in `go'
30: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `execute'
29: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `each'
28: from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `block in execute'
27: from /usr/lib/ruby/vendor_ruby/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
26: from /usr/lib/ruby/vendor_ruby/jekyll/commands/build.rb:39:in `process'
25: from /usr/lib/ruby/vendor_ruby/jekyll/commands/build.rb:72:in `watch'
24: from /usr/lib/ruby/vendor_ruby/jekyll/watcher.rb:10:in `watch'
23: from /usr/lib/ruby/vendor_ruby/listen/listener.rb:91:in `start'
22: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:57:in `transition'
21: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:91:in `transition_with_callbacks!'
20: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:121:in `call'
19: from /usr/lib/ruby/vendor_ruby/listen/fsm.rb:121:in `instance_eval'
18: from /usr/lib/ruby/vendor_ruby/listen/listener.rb:68:in `block in <class:Listener>'
17: from /usr/lib/ruby/2.6.0/forwardable.rb:230:in `start'
16: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:63:in `start'
15: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:40:in `configure'
14: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:40:in `each'
13: from /usr/lib/ruby/vendor_ruby/listen/adapter/base.rb:45:in `block in configure'
12: from /usr/lib/ruby/vendor_ruby/listen/adapter/linux.rb:30:in `_configure'
11: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
10: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
9: from /usr/lib/ruby/vendor_ruby/rb-inotify.rb:1:in `<top (required)>'
8: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
7: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /usr/lib/ruby/vendor_ruby/rb-inotify/native.rb:1:in `<top (required)>'
5: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
4: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /usr/lib/ruby/vendor_ruby/ffi.rb:3:in `<top (required)>'
2: from /usr/lib/ruby/vendor_ruby/ffi.rb:6:in `rescue in <top (required)>'
1: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': **cannot load such file -- ffi_c (LoadError)**

Updating JSON column takes too long

create_table "drugs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "item_seq"
t.string "name"
t.string "short_description"
t.string "short_notice"
t.json "package_insert"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
I am trying to update my model Drug which is shown above. It has around 50,000 rows of data and I am using ruby code to update the items in the model using the data I am getting from separate api server.
The column I am trying to update is package_insert which has the type json.
I am only trying to update certain keys of the package_insert(BAR_CODE, EDI_CODE).
The problem I am having is that I cannot update multiple rows because it throws an error after performing commit on the first row.
The ruby code is shown below.
require 'json'
require 'net/http'
require 'active_support/core_ext/hash'
for i in 1..501
response = Net::HTTP.get_response(URI.parse(ENV["API_SERVER"])).body
hashed_response = Hash.from_xml(response)
hashed_response['response']['body']['items']['item'].each do |item|
#select drug to be updated
drug_to_change = Drug.find_by(item_seq: item['ITEM_SEQ'])
unless drug_to_change.nil?
package = JSON.parse(drug_to_change.package_insert)
package['DRB_ITEM']['BAR_CODE'] = item['BAR_CODE']
if !item['EDI_CODE'].nil?
package['DRB_ITEM']['EDI_CODE'] = item['EDI_CODE']
end
drug_to_change.update(package_insert: package.to_json)
else
new_item = Drug.new
new_item.item_seq = item['ITEM_SEQ']
new_item.name = item['ITEM_NAME']
#update
a = Hash.new
a["DRB_ITEM"] = item
new_item.save
end
end
end
when I run
# terminal
bin/rails runner lib/file_name.rb
# result
Running via Spring preloader in process 51929
Traceback (most recent call last):
85: from -e:1:in `<main>'
84: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
83: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
82: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
81: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
80: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
79: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
78: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
77: from /Users/jamie/Desktop/test_branch/bin/rails:9:in `<main>'
76: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
75: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
74: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
73: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
72: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
71: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
70: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
69: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
68: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
67: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
66: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
65: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
64: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
63: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
62: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/runner/runner_command.rb:38:in `perform'
61: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
60: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
59: from /Users/jamie/Desktop/test_branch/lib/renew_all.rb:5:in `<main>'
58: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/range/each.rb:9:in `each'
57: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/range/each.rb:9:in `each'
56: from /Users/jamie/Desktop/test_branch/lib/renew_all.rb:9:in `block in <main>'
55: from /Users/jamie/Desktop/test_branch/lib/renew_all.rb:9:in `each'
54: from /Users/jamie/Desktop/test_branch/lib/renew_all.rb:17:in `block (2 levels) in <main>'
53: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/persistence.rb:424:in `update'
52: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
51: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:212:in `transaction'
50: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `transaction'
49: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
48: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
47: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:252:in `block in within_new_transaction'
46: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:213:in `commit_transaction'
45: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
44: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:223:in `block in commit_transaction'
43: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:128:in `commit_records'
42: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/transactions.rb:346:in `committed!'
41: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:816:in `_run_commit_callbacks'
40: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:133:in `run_callbacks'
39: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:517:in `invoke_after'
38: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:517:in `each'
37: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:517:in `block in invoke_after'
36: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:261:in `block in conditional'
35: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:426:in `block in make_lambda'
34: from /Users/jamie/searchkick_forked/lib/searchkick/model.rb:78:in `reindex'
33: from /Users/jamie/searchkick_forked/lib/searchkick/record_indexer.rb:51:in `reindex'
32: from /Users/jamie/searchkick_forked/lib/searchkick/record_indexer.rb:74:in `reindex_record'
31: from /Users/jamie/searchkick_forked/lib/searchkick/logging.rb:27:in `store'
30: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `instrument'
29: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
28: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `block in instrument'
27: from /Users/jamie/searchkick_forked/lib/searchkick/logging.rb:28:in `block in store'
26: from /Users/jamie/searchkick_forked/lib/searchkick/index.rb:125:in `store'
25: from /Users/jamie/searchkick_forked/lib/searchkick/bulk_indexer.rb:43:in `bulk_index'
24: from /Users/jamie/searchkick_forked/lib/searchkick/indexer.rb:11:in `queue'
23: from /Users/jamie/searchkick_forked/lib/searchkick/logging.rb:126:in `perform'
22: from /Users/jamie/searchkick_forked/lib/searchkick/indexer.rb:18:in `perform'
21: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/elasticsearch-api-6.1.0/lib/elasticsearch/api/actions/bulk.rb:95:in `bulk'
20: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/elasticsearch-transport-6.1.0/lib/elasticsearch/transport/client.rb:131:in `perform_request'
19: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/elasticsearch-transport-6.1.0/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
18: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/elasticsearch-transport-6.1.0/lib/elasticsearch/transport/transport/base.rb:266:in `perform_request'
17: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/elasticsearch-transport-6.1.0/lib/elasticsearch/transport/transport/http/faraday.rb:23:in `block in perform_request'
16: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/connection.rb:387:in `run_request'
15: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/rack_builder.rb:143:in `build_response'
14: from /Users/jamie/searchkick_forked/lib/searchkick/middleware.rb:9:in `call'
13: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday_middleware-aws-sigv4-0.2.4/lib/faraday_middleware/request/aws_sigv4.rb:15:in `call'
12: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/adapter/net_http.rb:38:in `call'
11: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/adapter/net_http.rb:92:in `with_net_http_connection'
10: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/adapter/net_http.rb:43:in `block in call'
9: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-0.15.4/lib/faraday/adapter/net_http.rb:87:in `perform_request'
8: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:1455:in `request'
7: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:909:in `start'
6: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
5: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:935:in `connect'
4: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
3: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
2: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:937:in `block in connect'
1: from /Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:937:in `open'
/Users/jamie/.rbenv/versions/2.5.3/lib/ruby/2.5.0/net/http.rb:937:in `initialize': execution expired (Faraday::ConnectionFailed)
Same code in rails console results:
irb(main):017:0>drug_to_change.update(package_insert: package.to_json)
(17.2ms) BEGIN
(0.3ms) COMMIT
Drug Store (30237.8ms) {"id":1,"exception":["Faraday::ConnectionFailed","execution expired"],"exception_object":"execution expired"}
Traceback (most recent call last):
1: from (irb):17
Faraday::ConnectionFailed (execution expired)
I am guessing the problem is due to mysql commit taking too long. How can I solve this issue? Thanks in advance.
SHOW CREATE TABLE drugs;
Error Faraday::ConnectionFailed suggests that you have an http request somewhere in the update chain (package_insert= setter, model validation or callbacks) that fails with this error. This is also proven by fact that simple update via console gives the same result.
Since error is reproduced by simple obj.update(package_insert: some_json), it does not relate directly to script you provided. Look into your model, especially before_*/after_*, most probably there's some after_save callback that makes an http request (as a rule of thumb - external requests from model callbacks are generally a bad idea unless you're sure how and why you do them)

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.

Problems with mysql Rails

While starting the server or create a new scaffold this problem appears.
Traceback (most recent call last):
18: from bin/rails:4:in `<main>'
17: from bin/rails:4:in `require'
16: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
15: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
14: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
13: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
12: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
11: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
10: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/generate/generate_command.rb:19:in `perform'
9: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
8: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/actions.rb:15:in `require'
7: from /home/jeyjeyanischixx/ruby/auto/config/application.rb:17:in `<top (required)>'
6: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
5: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
4: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
3: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
2: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
1: from /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'turbolinks'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Turbolinks::Source
Backtrace for gem load error is: /home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/turb olinks-5.1.1/lib/turbolinks.rb:18:in `<class:Engine>'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/turbolinks-5.1.1/lib/turbolinks.rb:15:in `<module:Turbolinks>'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/turbolinks-5.1.1/lib/turbolinks.rb:6:in `<top (required)>'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/home/jeyjeyanischixx/ruby/auto/config/application.rb:17:in `<top (required)>'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/actions.rb:15:in `require'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/generate/generate_command.rb:19:in `perform'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
/home/jeyjeyanischixx/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
Your error is coming from the bundler trying to bundle your gems:
in require': There was an error while trying to load the gem 'turbolinks'. (Bundler::GemRequireError)
This error is thrown because somewhere in either your code or code in a library there is a constant called Turbolinks::Source that was never set to anything, so somewhere the code is calling Turbolinks::Source, but because its not referencing anything, it throws an error. Without sharing your code it will be difficult to give you a better answer.

Permission Denied when creating myapp in ruby on rails

As the first time with linux and ruby on rails, I am following this guide, https://gorails.com/setup/windows/10 everthing in the steps works fine except the final step when I tried to execute this command.
rails new myapp -d mysql
after hitting enter I got this message.
/home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir': Permission denied # dir_s_mkdir - /myapp (Errno::EACCES)
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:211:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:50:in `block in invoke!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:49:in `invoke!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:14:in `empty_directory'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/generators/app_base.rb:153:in `create_root'
from (eval):1:in `create_root'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/application.rb:17:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/cli.rb:14:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/exe/rails:9:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/bin/rails:22:in `load'
from /home/fil/.rbenv/versions/2.3.3/bin/rails:22:in `<main>'
What is the problem?, can you suggest a solution?