-
Notifications
You must be signed in to change notification settings - Fork 344
Avoid -I rubylibdir with default-gem bundler #595
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reproductive steps# Use clean Ruby 2.6.x, or uninstall any non-default bundler installation
$ rails new springapp --skip-active-record
$ cd springapp
$ echo 'gem "json", "1.8.6"' >> Gemfile
$ bundle install
$ DISABLE_SPRING=1 bin/rails r 'p JSON.load(nil)'
nil
$ DISABLE_SPRING=0 bin/rails r 'p JSON.load(nil)'
Running via Spring preloader in process 17934
Traceback (most recent call last):
# ...
/home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse': 784: unexpected token at 'null' (JSON::ParserError)I believe this is not something we want. Example$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
$ rails -v
Rails 5.2.3
$ gem list | grep bundler
bundler (default: 1.17.2)
$ rails new springapp --skip-active-record
# ...
$ cd springapp
$ echo 'gem "json", "1.8.6"' >> Gemfile
$ bundle install
# ...
$ bundle exec spring -v
Spring version 2.1.0
$ DISABLE_SPRING=1 bin/rails r 'p JSON.load(nil)'
nil
$ bin/spring stop
Spring is not running
$ DISABLE_SPRING=0 bin/rails r 'p JSON.load(nil)'
Running via Spring preloader in process 17934
Traceback (most recent call last):
28: from -e:1:in `<main>'
27: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
26: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
25: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
24: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
23: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
22: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
21: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
20: from /home/k0kubun/tmp/springapp/bin/rails:9:in `<main>'
19: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
18: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
17: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
16: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
15: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
14: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
13: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
12: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
11: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>'
10: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
9: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
8: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
7: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
6: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
5: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `perform'
4: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `eval'
3: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/runner/runner_command.rb:41:in `<main>'
2: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/json/common.rb:335:in `load'
1: from /home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/home/k0kubun/.rbenv/versions/2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse': 784: unexpected token at 'null' (JSON::ParserError) |
kamipo
approved these changes
Jul 10, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 People who using Ruby 2.6 may be faced with this issue as we've faced.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since Ruby 2.6.0, bundler.gem has been a default gem. It means that
$LOADED_FEATURES.grep(/bundler\/setup\.rb$/).firstcould be the same asRbConfig::CONFIG["rubylibdir"], which is the default gem directory and not dedicated for a specific bundler version, if no newer bundler were manually installed.Passing default gem directory with
-Iis really problematic because it has other default gems like json.gem, and-Iis prioritized more than$LOAD_PATHs added byBundler.require. Using default-gem Bundler could cause a wrong default gem version onspring serverprocess.