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
fileutils conflict in Ruby 2.5.1 #22
Comments
This is warnings, not error. But I understood this issue is harmful. I try to resolve this. |
I think this is causing some errors. I can't prove it, but after updating system gems today I got this error, and now about half of my previously working rake tasks hang and can't be quit. Nothing has changed in the rake task except for gems being updated that rely on this gem. |
Same issue here. Updated system gems today. Anyone got a solution for this? |
I've looked to see if there's a way to blacklist a gem from my system, but my searches have come up empty. It's getting old having to add Maybe 1.1.0 needs to be yanked until this problem can be fixed? |
Ran into this, and the solution here works: https://stackoverflow.com/questions/51334732/rails-5-2-0-with-ruby-2-5-1-console-warning-already-initialized-constant I understand 1.0.2 stays installed as the default, 1.1.0 being installed too. Hence the issue. When installed automatically, I get the warnings. Following command shows (new rails app, 2.5.1) :
Then doing:
makes the warnings disappear. And btw, it shows:
Hope it will help fixing this annoyance. Sorry I cannot be of more help, not really a wizard with those versioning topics! |
I see there is a pull request which seems to indicate it deals with this specific issue. Anyone? |
Thanks @MicMicMon! I use rvm, so I had to |
Persists after an update to
@MicMicMon's workaround is still effective. Thanks! |
fileutils (1.2.0, default: 1.1.0) some issue temp solution fileutils (default: 1.2.0, default: 1.1.0) |
@Fudoshiki I actually just ran |
Not warning when I execute
|
Still exist.
|
I logged an issue over in rails/spring a couple of months ago about this. I think spring is loading gems using whatever rules it wants to, rather than letting Bundler direct it towards the correct gem. I don't think this is a FileUtils issue. |
@scottmacpherson Yes, also If you're using Bootsnap with Spring, it's the likely culprit: The problem is that Bootsnap is requiring e.g. instead of This is a problem because Spring already loads This happens on a default Rails install (assuming you have a newer fileutils version installed), so I imagine that is the source of many of the reports regarding this issue. |
I ran into this issue just from a freshly generated rails 6.0.2 despite having fileutils uninstalled. |
@kockok What is the output of |
fileutils (default: 1.4.1, default: 1.1.0) |
@kockok You can't have multiple versions installed if you use Bootsnap.
|
I'm having this same issue.
Since they are both default, I can't remove either of them.
|
I fixed it by uninstalling every version of ruby except for one, I kept 2.6.1. |
its a temporary solution for now.. i hope they will fix this issues in future... lets fix the issues with this command for now... |
Still have this issue with Ruby 2.7.0, wanted to check on the status. What's blocking to solve the matter here? Workarounds are supposed to be temporary, it would be nice to definitively fix this. How can we help? Edit: I realize it might not be the same scenario exactly, it happens after generating bundle binstubs. Though, closing this issue would still be nice. |
Patch welcome. |
Actually, after investigation, it wasn't this issue at all which seems to have disappeared by the way: $ gem list | grep fileutils
fileutils (default: 1.4.1) Maybe this issue could be closed altogether unless it still applies to some scenarios? If anyone ends up here too with the same problem I just had: it was an issue with bundler versions mismatch that will be fixed in an upcoming release: rubygems/rubygems#3257 & rubygems/rubygems#3284 (comment). Temporary workaround is to run |
@qortex I don't think the issues in rubygems are related, nor that this is an issue with The underlying issue is a problem in bootsnap as @aar0nr explained in #22 (comment). @hsbt I think this issue should be closed and fixed in bootsnap. If a gem requires default gems directly from rubylibdir without respecting load path resolution nor rubygems default gem upgrade mechanism, there's not much we can do about it. |
I'll look into making a PR to bootsnap to fix this issue tomorrow. |
@deivid-rodriguez I can reproduce this issue on Ruby 2.6.6 without bootsnap installed. I have the following fileutils versions:
With a reasonably standard Rails app, both with and without bootsnap, running just |
Thanks. If you could share reproduction steps, or a public repo where I can see it, I can have a look at it. |
Ah I didn't forget about fixing this in bootsnap, I just need to find the time 😅. |
The immediate problem is with a private project, but I'll see if I can reproduce with a public one this weekend. |
I can reproduce this without bootsnap as follows: $ ruby --version
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
% [matijs@bean] gem list fileutils
*** LOCAL GEMS ***
fileutils (1.4.1, default: 1.1.0)
$ rails --version
Rails 6.0.2.2
$ rails new file_utils_conflict --skip-bootsnap
[...long output skipped...]
$ cd file_utils_conflict
$ rails s
[...] |
Same here, and a couple of /bin/spring in a fresh Rails project actually explicitly states that Spring loads without using Bundler, which means that when other, bundle-abiding gems are loaded, the version of Fileutils packaged with the installed version of Ruby has already been loaded. Perhaps rails/spring#603 should be reopened? |
Thanks for the repros! I could replicate this, and it now seems like a bug in bundler, actually. I'm currently validating a potential fix, will keep you posted. |
I think I misspoke: Rubygems loads the most recent version of an installed gem, whether it's a default gem or not. Bundler defaults to loading the version of default gems that was packed with the relevant Ruby version (unless told otherwise via Gemfile). This still explains what we're seeing: Spring and/or Bootsnap don't use Bundler, therefore end up loading the latest version of each required gem (e.g. Fileutils 1.4.1). Then other bundle-abiding gems start getting loaded, and since a specific version of Fileutils isn't defined in Gemfile, it's version 1.1.0 that gets loaded this time. |
Yup, @scottmacpherson, that's exactly the problem. Yesterday I experimented with changing |
I’m experiencing something similar when building my Jekyll website. Here’s my log, I hope it can be useful.
|
Sorry, I forgot about this. Changing this in |
I created a PR in the |
As this issue doesn't appear to be in fileutils itself, I'm going to close it. |
@deivid-rodriguez earlier it was mentioned about Bootsnap being the cause. Do you think it's still an issue Bootsnap should address or just Spring? |
To me it's unexpected that |
For anyone still having this issue, this actually is caused by some kind of dependency issue when sharing constants between files. For example:
If you create a constant in one file and create it in another (duplicates), but remove the constant from one of the files, it will flag this issue. So just removing the require fields and reload the Could possibly be due to Object Retention as stated here in regards to no garbage collection for constants and they are never released from memory. |
Debian Linux 8.10 Jessie
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
rubygems-update (2.7.7)
Error log:
The text was updated successfully, but these errors were encountered: