Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'rails c' doesn't start #223

Closed
joaopedromattos opened this issue Jan 24, 2019 · 12 comments
Closed

'rails c' doesn't start #223

joaopedromattos opened this issue Jan 24, 2019 · 12 comments

Comments

@joaopedromattos
Copy link

joaopedromattos commented Jan 24, 2019

What happens:

When running 'rails c' on terminal it returns me this strange error I.

Running via Spring preloader in process 4371
Traceback (most recent call last):
	37: from -e:1:in `<main>'
	36: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	35: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	34: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
	33: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	32: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
	31: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
	30: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
	29: from /home/joaopedromattos/Documentos/imob/imobiliario/bin/rails:9:in `<main>'
	28: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
	27: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	26: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
	25: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
	24: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
	23: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
	22: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
	21: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
	20: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
	19: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command.rb:44:in `invoke'
	18: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command.rb:70:in `find_by_namespace'
	17: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command/behavior.rb:79:in `lookup'
	16: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command/behavior.rb:79:in `each'
	15: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command/behavior.rb:80:in `block in lookup'
	14: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command/behavior.rb:80:in `each'
	13: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
	12: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
	11: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	10: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
	 9: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
	 8: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
	 7: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
	 6: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
	 5: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
	 4: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands/console/console_command.rb:3:in `<main>'
	 3: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
	 2: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	 1: from /home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/home/joaopedromattos/Documentos/imob/imobiliario/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- irb (LoadError)

Going to the pointed line in this file I find this method:

raise Bootsnap::LoadPathCache::CoreExt.make_load_error(path)

Does anybody knows what might be the problem?

Thanks in advance!

@rafaelfranca
Copy link
Member

cannot load such file -- irb

Are you able to load irb in your ruby?

@joaopedromattos
Copy link
Author

Yes, I'm able to load irb.

@rafaelfranca
Copy link
Member

Just for curiosity does it work when you create the app and install the gems inside a folder that has all lowercase character? It seems you app is inside Documentos.

@joaopedromattos
Copy link
Author

Well, yes. I've always used rails and installed it's gems into projects that were inside Upper case characters folders, such as Documentos.

@rafaelfranca
Copy link
Member

Right, I'm just asking to know if that is the cause of the issue. If it does working when the path is all lowercase it means our cache is not case sensitive and we need to fix this.

@jules2689
Copy link
Contributor

What OS version is this? Mac OS is known to have a significant amount of issues with allowing mix-case files, and having case sensitivity issues - so it's possible this is the issue since making the cache case sensitive could affect different OSes.

@jules2689
Copy link
Contributor

I found this, which may be related. rubygems/bundler#6929

@msdundar
Copy link

msdundar commented Feb 13, 2019

Same here. I'm getting:

uninitialized constant Zeitwerk (NameError)

  • Platform: Ubuntu 18.04
  • Rails: 6.0.0.beta1
  • Ruby: 2.6.1p33
  • Bundler: 2.0.1

Error log: https://gist.github.com/msdundar/fa3ffd3c4109ba6c21a558f35ae0a8d0
Gemfile.lock: https://gist.github.com/msdundar/678e1ced827413a0f17f9b1ceb60f260

@rafaelfranca
Copy link
Member

This is not related and it is a bug in rails.

@burke burke closed this as completed Feb 19, 2019
@burke burke reopened this Feb 19, 2019
@molaeiali
Copy link

molaeiali commented May 16, 2019

Having the same problem with @joaopedromattos
$ rails -v
rails 5.2.3
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
$ irb -v
irb 1.0.0 (2018-12-18)
$ gem info bootsnap
*** LOCAL GEMS ***

bootsnap (1.4.4)
Author: Burke Libbey
Homepage: https://github.com/Shopify/bootsnap
License: MIT
Installed at: /home/ali/.gem/ruby/2.6.0

Boot large ruby/rails apps faster

jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Jul 13, 2019
Ever since upgrading to Ruby 2.6, I've experienced the following crash
when running `bin/rails console`:

```
$ bin/rails c
warning package.json: No license field
warning No license field
Running via Spring preloader in process 12917
Traceback (most recent call last):
	28: from -e:1:in `<main>'
	27: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	26: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	25: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	24: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	23: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
	22: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	21: from /home/jeremy/gitting/worldcubeassociation.org/WcaOnRails/bin/rails:11:in `<top (required)>'
	20: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	19: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	18: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	17: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	16: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
	15: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:44:in `invoke'
	14: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:70:in `find_by_namespace'
	13: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `lookup'
	12: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `each'
	11: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `block in lookup'
	10: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `each'
	 9: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
	 8: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 7: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 6: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	 5: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 4: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/console/console_command.rb:3:in `<top (required)>'
	 3: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 2: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 1: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- irb (LoadError)
```

Some Googling let me on the following journey:
  - https://www.reddit.com/r/rails/comments/akhmae/ruby_26_breaks_rails_console/ ->
  - Shopify/bootsnap#223 ->
  - rubygems/bundler#6929 (comment)

So, this appears to be due to a bundler change, and one workaround is to
explicitly add `irb` to your Gemfile. It seems like this may be fixed in
a future version of bundler: rubygems/bundler#6963.
jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Jul 13, 2019
Ever since upgrading to Ruby 2.6 (see
thewca#3873), I've
experienced the following crash
when running `bin/rails console`:

```
$ bin/rails c
warning package.json: No license field
warning No license field
Running via Spring preloader in process 12917
Traceback (most recent call last):
	28: from -e:1:in `<main>'
	27: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	26: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	25: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	24: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	23: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
	22: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	21: from /home/jeremy/gitting/worldcubeassociation.org/WcaOnRails/bin/rails:11:in `<top (required)>'
	20: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	19: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	18: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	17: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	16: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
	15: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:44:in `invoke'
	14: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:70:in `find_by_namespace'
	13: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `lookup'
	12: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `each'
	11: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `block in lookup'
	10: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `each'
	 9: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
	 8: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 7: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 6: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	 5: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 4: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/console/console_command.rb:3:in `<top (required)>'
	 3: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 2: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 1: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- irb (LoadError)
```

At first I thought this was a quirk of my local environment, but some
Googling let me on the following journey:
  - https://www.reddit.com/r/rails/comments/akhmae/ruby_26_breaks_rails_console/ ->
  - Shopify/bootsnap#223 ->
  - rubygems/bundler#6929 (comment)

So, this appears to be due to a bundler change, and one workaround is to
explicitly add `irb` to your Gemfile. It seems like this may be fixed in
a future version of bundler: rubygems/bundler#6963.
jfly added a commit to thewca/worldcubeassociation.org that referenced this issue Jul 28, 2019
Ever since upgrading to Ruby 2.6 (see
#3873), I've
experienced the following crash
when running `bin/rails console`:

```
$ bin/rails c
warning package.json: No license field
warning No license field
Running via Spring preloader in process 12917
Traceback (most recent call last):
	28: from -e:1:in `<main>'
	27: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	26: from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	25: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	24: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	23: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
	22: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
	21: from /home/jeremy/gitting/worldcubeassociation.org/WcaOnRails/bin/rails:11:in `<top (required)>'
	20: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	19: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	18: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	17: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	16: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
	15: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:44:in `invoke'
	14: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:70:in `find_by_namespace'
	13: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `lookup'
	12: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:79:in `each'
	11: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `block in lookup'
	10: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:80:in `each'
	 9: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
	 8: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 7: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 6: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
	 5: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 4: from /home/jeremy/.gem/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/console/console_command.rb:3:in `<top (required)>'
	 3: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
	 2: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	 1: from /home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/jeremy/.gem/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- irb (LoadError)
```

At first I thought this was a quirk of my local environment, but some
Googling let me on the following journey:
  - https://www.reddit.com/r/rails/comments/akhmae/ruby_26_breaks_rails_console/ ->
  - Shopify/bootsnap#223 ->
  - rubygems/bundler#6929 (comment)

So, this appears to be due to a bundler change, and one workaround is to
explicitly add `irb` to your Gemfile. It seems like this may be fixed in
a future version of bundler: rubygems/bundler#6963.
@betoharres
Copy link

I had the same issue on Arch linux.
Saw the referenced post above saying to add irb to the Gemfile and decided to try it, and it worked!

Not sure why, too bad rails can't get up and running easily on a cross-platform environment ...

Gemfile:

group :development, :test do
  # Call 'byebug' anywhere in the code to stop
  # execution and get a debugger console
  gem 'byebug', platforms: %i[mri mingw x64_mingw]
  gem 'irb', require: false
end

@apuppy
Copy link

apuppy commented Aug 5, 2021

I had the same issue on Arch linux.
Saw the referenced post above saying to add irb to the Gemfile and decided to try it, and it worked!

Not sure why, too bad rails can't get up and running easily on a cross-platform environment ...

Gemfile:

group :development, :test do
  # Call 'byebug' anywhere in the code to stop
  # execution and get a debugger console
  gem 'byebug', platforms: %i[mri mingw x64_mingw]
  gem 'irb', require: false
end

It worked for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants