Bundler 0.9.25, Rails 2.3.8 and vendor/gems has no specification file error

Majority of us have seen this dreadful error after running rake:gems:unpack or a similar command to register gems with the application.

config.gem: Unpacked gem clearance-0.8.8 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.

I was under the impression that this happens due to some bug in rails gem dependency management and never expected the same to happen with Bundler. Unfortunately, I was wrong. Just yesterday, I had this error and it’s one of those things that doesn’t really stop your app from working but is very annoying.

There is a fix on Stack Overflow but it might not work if you are using bundler. The command to use remains the same but it needs to be slightly modified. Here are the steps:

This assumes that you get this error with clearance.
Step 1

cd vendor/gems/clearance-0.8.8

Step 2

gem specification ../../cache/clearance-0.8.8.gem > .specification

With bundler the gem files are actually stored in the vendor/cache directory. specification is a gem command that extracts a .specification file from gem file. Here’s full explanation of it.

That’s it. Wasn’t that easy?

About andhapp

Namastey (Hello) Stranger, This is not the geekiest blog on the planet yet it is not the dumbest one either. I am a small time developer who likes to explore new technologies. I usually program in Java, Groovy and Ruby and take keen interest in the surrounding geeky developments.
This entry was posted in Programming and tagged , , , . Bookmark the permalink.

One Response to Bundler 0.9.25, Rails 2.3.8 and vendor/gems has no specification file error

  1. cloudsrv says:

    Nice one… did not know that. thx

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>