In my gem development directory, I moved the file lib/project/module.rb to lib/project/helpers/module.rb and then did
bundle install
This gave me an invalid gemspec error
project at /path/project did not have a valid gemspec. This prevents bundler from installing bins or native extensions, but that may not affect its functionality. The validation message from Rubygems was:
["lib/project/module.rb"] are not files
Why am I getting this error?
The problem occured because gemspec uses git to validate the presence of required files.
Instead of doing a normal mv
mv lib/project/module.rb lib/project/helpers/
It's better to do a git mv
git mv lib/project/module.rb lib/project/helpers/
After reverting the move and doing the git mv, bundle install worked without any validation errors.
It is also better practice in general to do git mv rather than mv in a git repo, because it can potentially keep you commits looking cleaner. What's the purpose of git-mv?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With