Skip to content

Use Gem.use_paths method for setting paths #473

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 1 commit into from
Jul 15, 2016
Merged

Use Gem.use_paths method for setting paths #473

merged 1 commit into from
Jul 15, 2016

Conversation

morgoth
Copy link
Member

@morgoth morgoth commented Feb 26, 2016

It fixes case for JRuby which returns a regexp from Gem.path_separator,
but also improves code by using built in method instead of passing string that later is changed to array again.

It follows discussion from https://github.com/rails/spring/pull/472/files#r54284442

It fixes case for JRuby which returns a regexp from Gem.path_separator,
but also improves code by using built in method instead of passing string that later is changed to array again.
@rails-bot
Copy link

r? @grosser

(@rails-bot has picked a reviewer for you, use r? to override)

@grosser
Copy link
Collaborator

grosser commented Feb 26, 2016

👍

@jeremy double check plz

@jeremy
Copy link
Member

jeremy commented Feb 26, 2016

lgtm /cc @tenderlove

@morgoth
Copy link
Member Author

morgoth commented Mar 19, 2016

@tenderlove Do you think this solution is good to go?

@arthurnn
Copy link
Member

This happened to me after I upgraded to rubygem 2.6.6. Before I always at 2.4.5.1 and everything was fine.

@@ -38,7 +38,7 @@ class Binstub < Command
require 'bundler'

if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this going to work on old versions of rubygems?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the method is there for a while indeed.

@arthurnn arthurnn merged commit bb11959 into rails:master Jul 15, 2016
@arthurnn
Copy link
Member

double checked and it works fine.
Now everyone that has the problem will have the re-generate their binstubs, is that the solution?

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.

5 participants