Reputation: 10952
After installing Ruby 2.5 using RVM, and building an application using Rails5.2.0.rc1, I get warnings whenever I run rake:
/Users/danielkehoe/.rvm/gems/ruby-2.5.0@global/gems/rake-12.3.0/lib/rake/file_utils.rb:10:
warning: already initialized constant FileUtils::RUBY
/Users/danielkehoe/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/file_utils.rb:10:
warning: previous definition of RUBY was here
/Users/danielkehoe/.rvm/gems/ruby-2.5.0@global/gems/rake-12.3.0/lib/rake/file_utils.rb:109:
warning: already initialized constant FileUtils::LN_SUPPORTED
Upvotes: 2
Views: 1157
Reputation: 1163
Unfortunately none of tm.'s methods worked for me.
When I looked at my global gemset, I had a version 1.1.0 of fileutils
installed as well as the default 1.0.2
gem uninstall fileutils
removed the 1.1.0 version and this downgrade to 1.0.2 solved the problem.
Upvotes: 5
Reputation: 314
It is related to RVM. Specifically, it's because the rake
gem is symlinked from the installed copy of ruby into the @global gemset, but bin/rake
is not symlinked. As a result, rake tries to load copies of certain library files twice--once from the standard ruby gem tree and one from the @global gemset tree.
I've found several workarounds:
bundle exec rake
bin/rails
rails <cmd>
(or bin/rails
)rake
gem into your current gemset. This will preempt the standard + @global gemset copy of rake, thus avoiding the issue.Upvotes: 3
Reputation: 1603
It seems the issue is related torvm.
check the issue created for rake project
Upvotes: 0