bundle install causes validation error after moving file
Asked Answered
D

2

5

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?

Dominion answered 20/11, 2013 at 5:36 Comment(0)
D
12

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?

Dominion answered 20/11, 2013 at 5:36 Comment(1)
Actually a simple git add . --all removed this warning!Platt
M
3

Probably you have modified name of that file and didn't commit that changes.

git add .

Will solve the problem.

Maneating answered 16/12, 2014 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.