Unpacked gem in vendor/gems not in a versioned directory
-
19-09-2019 - |
Question
I unpacked a gem into my vendor/gems
directory and tried to run my Rails app.
I got this message:
Unpacked gem in vendor/gems not in a versioned directory
I don't understand this error and judging by the Google search results for this error there are not many people who have experienced this problem.
Could this mean I also need to vendor Rails to use vendor/gems
?
Solution
You don't need to vendor Rails to use vendor gems.
Normally gems unpack to a directory called something like vendor/gems/some_gem-1.2.3
. Check that all your vendored gem directories follow this pattern (i.e. GEM_NAME-VERSION).
OTHER TIPS
The much easier and more robust way is to use gem dependencies.
Then if you want to unpack your gems into vendor/gems its as easy as typing:
rake gems:unpack
You do not need to vendor rails in order to vendor gems, the error appears to be a user error you are decompressing the gem into the wrong location and missing some version info.
Did you do this manually or using rake? Since a gem in the vendor/gems
directory has this format - gem-name-VERSION
.
For example the ruby-openid
gem will be unpacked to vendor/plugins/ruby-openid-2.1.7/
.
Try using rake gems:unpack
to unpack the gems.