prism
prism copied to clipboard
Problem requiring "prism/translation/parser33"
I found a bug when loading the "prism/translation/parser33" using rubocop with bundler. I could reproduce the same error only requiring prism abd parser33 so the problem is actually from the prism gem parser and not from rubocop.
Current behaviour
When runing
require "prism"
require "prism/translation/parser33"
it throws error because the file versions/3.3.1/lib/ruby/gems/3.3.0/gems/prism-0.29.0/lib/prism/translation/parser.rb cannot load the parser gem. Here is the full log
<internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- parser (LoadError)
from <internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /home/domingo/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/prism-0.29.0/lib/prism/translation/parser.rb:3:in `<top (required)>'
from <internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /home/domingo/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/prism-0.29.0/lib/prism/translation/parser33.rb:6:in `<module:Translation>'
from /home/domingo/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/prism-0.29.0/lib/prism/translation/parser33.rb:4:in `<module:Prism>'
from /home/domingo/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/prism-0.29.0/lib/prism/translation/parser33.rb:3:in `<top (required)>'
from <internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/home/domingo/.rbenv/versions/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from main.rb:2:in `<main>'
This affects the running of rubocop when running with bundler. Here is all my enviroment information to reproduce the problem
Ruby Version: ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux] OS: Ubuntu 22.04.3 LTS (In Windows 10 WSL)
Gemfile:
# frozen_string_literal: true
source "https://rubygems.org"
gem "prism", "~> 0.29.0"
Gemfile.lock:
GEM
remote: https://rubygems.org/
specs:
prism (0.29.0)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
prism (~> 0.29.0)
BUNDLED WITH
2.5.9