Error run rails fly console

When I run the command fly console , I encounter the error: “uninitialized constant IRB (NameError)” .

logs:

➜ fly  console    
Created an ephemeral machine 3d8ddd7a666589 to run the console.
Connecting to fdaa:6:5ee8:a7b:1f61:b8fd:e490:2... complete
/rails/vendor/ruby/3.3.0/gems/irb-1.11.2/lib/irb/workspace.rb:9:in `<main>': uninitialized constant IRB (NameError)

IRB::TOPLEVEL_BINDING = binding
^^^
Did you mean?  ERB
	from /rails/vendor/ruby/3.3.0/gems/irb-1.11.2/lib/irb/context.rb:7:in `require_relative'
	from /rails/vendor/ruby/3.3.0/gems/irb-1.11.2/lib/irb/context.rb:7:in `<main>'
	from /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /rails/vendor/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /rails/vendor/ruby/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
	from /rails/vendor/ruby/3.3.0/gems/mission_control-jobs-0.1.1/lib/mission_control/jobs/engine.rb:66:in `block in <class:Engine>'
	from /rails/vendor/ruby/3.3.0/gems/railties-7.1.3/lib/rails/railtie.rb:273:in `block in run_console_blocks'

fly config:

app = 'my-app'
primary_region = 'gru'
console_command = './bin/rails console'

[build]

[deploy]
  release_command = "./bin/rails db:prepare"

[processes]
  web = "./bin/rails server"
  worker = "./bin/rails solid_queue:start"```

Can you describe how you are vendoring Rails?

I tried:

rails new demo-24112
cd demo-24112
echo 'Rails.application.routes.draw { root "rails/welcome#index" }' > config/routes.rb
bin/rails generate dockerfile --force --jemalloc --fullstaq
fly launch
fly deploy
fly console

And this worked for me. With Ruby 3.3.0, fullstaq, and jemalloc. The one difference I can spot is that you have a /rails/vendor directory and I do not.

I’m experiencing the same issue. And looking at my error message, I don’t have a /rails/vendor directory, so I don’t think it’s related.

fly console                     
Created an ephemeral machine 9080e474c96de8 to run the console.
Connecting to fdaa:6:67aa:a7b:175:643c:bae1:2... complete
/usr/local/bundle/ruby/3.3.0/gems/irb-1.11.2/lib/irb/workspace.rb:9:in `<main>': uninitialized constant IRB (NameError)

IRB::TOPLEVEL_BINDING = binding
^^^
Did you mean?  ERB
2 Likes

I believe that’s something new. I started seeing this problem today in a DO server. Investigating where the error originated. Any ideas?

I tried:

  1. update ruby (to 3.3.0), didn’t work
  2. dowgrade Rails (to 7.1.2), didn’t work

I’m trying now uninstall the latest gems.

Adding gem “irb” in the Gemfile fixes for me

1 Like

Can confirm, adding gem irb in Gemfile fixed the issue for me too. Thanks @devanil !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.