Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle install causes validation error after moving file

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?

like image 518
frediy Avatar asked Nov 20 '13 05:11

frediy


1 Answers

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?

like image 95
frediy Avatar answered Oct 04 '22 01:10

frediy