ruby / ruby/reline

Rails 8.1.1 Ruby 3.4.0 no implicit conversion of Array into Integer (TypeError)

Open
#870 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
311
Forks
99
Avg merge
6d 4h
Merged PRs (30d)
1

Description

I get the following error when starting rails console in Rails 8.1.1 and Ruby 3.4.0
./console Array values in the parameter toGem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH" => ["/home/pst/.rbenv/versions/3.4.7/lib/ruby/gems/3.4.0", "/home/pst/.local/share/gem/ruby/3.4.0"]}) was passed in from bin/rails:3:in 'Kernel#load'
Running via Spring preloader in process 16688
Loading development environment (Rails 8.1.1)
/home/pst/.rbenv/versions/3.4.7/lib/ruby/gems/3.4.0/gems/reline-0.6.3/lib/reline/line_editor.rb:418:in 'block in Reline::LineEditor#render_line_differential': no implicit conversion of Array into Integer (TypeError)

    x, w, content = new_items[level]
                              ^^^^^
    from /home/pst/.rbenv/versions/3.4.7/lib/ruby/gems/3.4.0/gems/reline-0.6.3/lib/reline/line_editor.rb:410:in 'Array#each'

`
new_items is [0, 19, "pst(\e[34mdev\e[0m):001> "], [19, 0, ""]]
and level is [0, nil]
in that case

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with Rails console on Ruby 3.4.0, then inspect reline/line_editor.rb around lines 410-418. Trace how new_items and level become [0, nil], and verify the rendering path no longer raises the reported TypeError for that input.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.