Can't read csv file

I’m trying to read my csv file in the _data folder following the official documentation, and I’m having trouble with it. I don’t know much about ruby, and below is the output.

bundle exec jekyll serve --trace

Configuration file: /Volumes/programs/elx/elx6.xyz/_config.yml
Source: /Volumes/programs/elx/elx6.xyz
Destination: /Volumes/programs/elx/elx6.xyz/_site
Incremental build: disabled. Enable with --incremental
Generating…
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/3.0.0/bin/jekyll)
/usr/local/lib/ruby/gems/3.0.0/gems/csv-3.1.9/lib/csv.rb:1667:in read': wrong number of arguments (given 2, expected 1) (ArgumentError) from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:57:in read_data_file’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:46:in block in read_data_to' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:38:in each’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:38:in read_data_to' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:20:in read’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/reader.rb:18:in read' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:164:in read’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:69:in process' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in process_site’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in build' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in process’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in block in start' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in each’
from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in start' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in block (2 levels) in init_with_program’
from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each’
from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go’
from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/exe/jekyll:15:in <top (required)>’
from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in load' from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in <top (required)>’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:63:in load' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:63:in kernel_load’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:28:in run' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli.rb:494:in exec’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli.rb:30:in dispatch’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/cli.rb:24:in start’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/exe/bundle:49:in block in <top (required)>' from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/lib/bundler/friendly_errors.rb:130:in with_friendly_errors’
from /Users/tony/.gem/ruby/3.0.0/gems/bundler-2.2.16/exe/bundle:37:in <top (required)>' from /usr/local/opt/ruby/bin/bundle:23:in load’
from /usr/local/opt/ruby/bin/bundle:23:in `’

Jekyll 3 isn’t fully compatible with Ruby 3, so you’ll need to use Ruby 2.

1 Like

Thank you very much, and the problem is solved.

1 Like

I am still getting error with ruby 2.7.5 and jekyll 3.9.0. Any work around?
bundle exec jekyll build
npx percy snapshot _site/ --ignore-files “assets/python/**,parallel-universe/index.html”

Configuration file: /home/circleci/repo/docs/_config.yml
Source: /home/circleci/repo/docs
Destination: /home/circleci/repo/docs/_site
Incremental build: disabled. Enable with --incremental
Generating…
jekyll 3.9.0 | Error: wrong number of arguments (given 2, expected 1)
/home/circleci/.rubygems/gems/csv-3.2.3/lib/csv.rb:1791:in read': wrong number of arguments (given 2, expected 1) (ArgumentError) from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:57:in read_data_file’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:46:in block in read_data_to' from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:38:in each’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:38:in read_data_to' from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/readers/data_reader.rb:20:in read’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/reader.rb:18:in read' from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/site.rb:164:in read’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/site.rb:69:in process' from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in process_site’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in build' from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in process’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:18:in block (2 levels) in init_with_program' from /home/circleci/.rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute’
from /home/circleci/.rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' from /home/circleci/.rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute’
from /home/circleci/.rubygems/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' from /home/circleci/.rubygems/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program’
from /home/circleci/.rubygems/gems/jekyll-3.9.0/exe/jekyll:15:in <top (required)>' from /home/circleci/.rubygems/bin/jekyll:25:in load’
from /home/circleci/.rubygems/bin/jekyll:25:in <top (required)>' from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in load’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in kernel_load' from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:23:in run’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli.rb:483:in exec' from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli.rb:31:in dispatch' from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/cli.rb:25:in start' from /home/circleci/.rubygems/gems/bundler-2.3.11/exe/bundle:48:in block in <top (required)>’
from /home/circleci/.rubygems/gems/bundler-2.3.11/lib/bundler/friendly_errors.rb:103:in with_friendly_errors' from /home/circleci/.rubygems/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>’
from /home/circleci/.rubygems/bin/bundle:25:in load' from /home/circleci/.rubygems/bin/bundle:25:in

Exited with code exit status 1

Hmm, that error looks identical to the error when running under Ruby 3. Is there any chance that your CI host has been upgraded to Ruby 3? You might try adding a line to the build script to verify the Ruby version (i.e. ruby -v).

Can you share the contents of your CSV and the code that is reading the CSV file? Also, if you have a link to a public repo, that would work if you point to the files in question.

Thanks. Its issue of circle ci ruby 3. Downgraded and it’s working now.

1 Like