ruby / ruby/snap.ruby

bin/rails aborted! with stacktrace involving prism and bundled_gems.rb

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
32
Forks
5
Avg merge
14h 17m
Merged PRs (30d)
1

Description

When using the snap on Ubuntu 24.04.3, then installing rails, then creating a new rails project causes crash/error stacktrace (see below).


Steps to reproduce the problem

  1. Install ruby with sudo snap install ruby --classic
  2. gem install rails, which by default goes into ~/.gem
  3. Running rails new store will display bin/rails aborted! and a stacktrace that I'll paste below
  4. The project does get created, but running any of the following will crash with a similar stacktrace:
  • bin/rails server
  • bin/rails db:create

Expected behavior

No stacktrace.

Actual behavior

The commands do no succeed and produce the following:

/snap/ruby/438/lib/ruby/3.4.0/prism.rb:83: warning: already initialized constant Prism::BACKEND
/snap/ruby/438/lib/ruby/3.4.0/prism.rb:83: warning: previous definition of BACKEND was here
/snap/ruby/438/lib/ruby/3.4.0/prism.rb:83: warning: already initialized constant Prism::BACKEND
/snap/ruby/438/lib/ruby/3.4.0/prism.rb:83: warning: previous definition of BACKEND was here
/snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': NameError
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /snap/ruby/438/lib/ruby/3.4.0/prism.rb:85:in '<top (required)>'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from ~/.gem/gems/rubocop-ast-1.47.1/lib/rubocop/ast.rb:4:in '<top (required)>'
	from ~/.gem/gems/rubocop-ast-1.47.1/lib/rubocop-ast.rb:3:in 'Kernel#require_relative'
	from ~/.gem/gems/rubocop-ast-1.47.1/lib/rubocop-ast.rb:3:in '<top (required)>'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from ~/.gem/gems/rubocop-1.81.7/lib/rubocop.rb:19:in '<top (required)>'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /snap/ruby/438/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from ~/.gem/gems/rubocop-1.81.7/exe/rubocop:14:in '<top (required)>'
	from ~/.gem/bin/rubocop:25:in 'Kernel#load'
	from ~/.gem/bin/rubocop:25:in '<main>'

Ubuntu version

Ubuntu 24.04.3 LTS

Kernel version

Linux 6.14.0-34-generic

Ruby version

ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]

Rails version

Rails 8.1.1

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

Reproduce the failure on Ubuntu 24.04.3 with the listed snap, gem install, and Rails commands, then compare the stacktrace paths in prism.rb and bundled_gems.rb with the rubocop-ast loading path. The work is complete when rails new, bin/rails server, and bin/rails db:create run without the Prism warnings or NameError.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby, ubuntu
Domain
devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.