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

Add irb to Gemfile. #4306

Merged
merged 1 commit into from
Jul 28, 2019
Merged

Add irb to Gemfile. #4306

merged 1 commit into from
Jul 28, 2019

Conversation

jfly
Copy link
Contributor

@jfly jfly commented Jul 13, 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)

Some Googling let me on the following journey:

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.

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 jfly force-pushed the add-irb-to-gemfile branch from 5c8cd28 to ba22e73 Compare July 13, 2019 22:35
@AlbertoPdRF
Copy link
Contributor

That's weird; in my case, bin/rails c works both with and without the irb gem, but I have to delete the yarn.lock file and run bin/yarn install first.

@jfly
Copy link
Contributor Author

jfly commented Jul 28, 2019

I'm going to merge this up. If it causes any problems for people, let's definitely revert it.

@jfly jfly merged commit cbdc943 into thewca:master Jul 28, 2019
@jfly jfly deleted the add-irb-to-gemfile branch July 28, 2019 05:33
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

Successfully merging this pull request may close these issues.

2 participants