-
Notifications
You must be signed in to change notification settings - Fork 340
Unify method to detect Gemfile name #538
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
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I used it in my |
Hi sergey, Please let know what version of bundler and gem (gem -v) do you have. |
(spring init says `find_project_root': Spring was unable to locate the root of your project. There was no Gemfile present .......... ) Application root files: gems.rb gems.locked package.json Rakefile config.ru README.md gem -v |
Yeah, same error. Do:
|
Thank you for sample app! I checked app and your gists. It looks like application load spring 2.0.2 from your system instead of version downloaded from github: Please try to run application using bundle exec. It should load correct version of spring gem: |
bundle exec rails s Or bundle exec spring init |
Support was added by using Gemfile file name detection from Bundler gem.
Confirming |
Any update on this issue? I was able to insert the above changes into the spring 2.0.2 gem on my system, and both Specifically, I made the changes to |
Hi there! Any news? |
When run
However |
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.
spring/lib/spring/configuration.rb changes doesn't work
The The changes in this pull request work fine in isolation with both |
Yes trace shows me
to something and when |
Using spring 2.0.2 from source |
@JuPlutonic I'll try it again soon on my end, see if I get the same error you're seeing. |
So I did the following to make this work: Using an app with spring installed (2.0.2), go to the root directory of the app. Change Gemfile to gems.rb, and delete Gemfile.lock (and run Running Next, in the root directory type: Next, modify
You can also modify
At this point, your main spring gem is as if the changes from this pull request were already in a mainline release. Go back to your Rails root directory, and now
Note, I don't recommend changing gems on the filesystem in this manner for any long term solution, but it's to show that the changes from this pull request do work with and without Let me know if that works, or if something doesn't make sense that I can clarify. Thanks! |
I did the same test and it's sufficient to make it works. Actually I don't see why this PR is not merged yet since Any hints? BTW, it should not break : https://github.com/bundler/bundler/blame/7372d75243e6179f6258e2b5148fa89a7b64df8b/lib/bundler.rb#L351 |
All right. Bundle exec rails c / rails c
Hmm:
|
nothing to change -ff
?? |
@rafaelfranca Any actions to be taken on this? I can help recreate a new pull request with @JuPlutonic's changes incorporated if needed (or help in any other way to push this forward). It'd be great to see this ready in time for Rails 6.0.0 release! I also looked here for Ruby support of Rails, and it looks like Rails 5 (Ruby 2.2.2+) and Rails 6 (Ruby 2.5.0+) don't need the patch for Ruby 1.9.3 support, only Rails 4.2 would need this. And given that Rails 6 is out in a few months, this patch may only be needed temporarily then (as I'm guessing spring follows Rails End-Of-Life cycle) and support would be dropped for Rails 4.2 (Ruby 1.9.3). |
@rafaelfranca fixed by 647b8c3 Thank you! 👍 |
Background
Bundler 1.9 added support for changed Gemfile name:
gems.rb
. (related bundler issue)Spring use Bundler method to find Gemfile in binstub but in configuration it use custom method, which don't cover new Gemfile name (gems.rb).
Pull request
This pull request unify Gemfile name detection by using Bundler method in both places. Old behavior still works like expected and now support also gems.rb file.