How to solve `cached_specs’: undefined method `spec’ for nil:NilClass error

October 27, 2010 § 6 Comments

I try to run “bundle install” (bundler gem) and in the middle of the installation process i got my hardisk space is full. so i cut the process and remove some data then try to install again, so i run the “bundle install” again and get error like this :

/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:199:in `cached_specs': undefined method `spec' for nil:NilClass (NoMethodError)

from/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:196:in `each’

from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:196:in `cached_specs’

and many moooorreeee…..

that error caused of broken installation of the gems that using “bundle install” so to solve it we must delete the broken file (gem).

we can locate the current gem folder using:

gem list -d bundler

then we can see there is a cahce folder, u can remove or rename the folder (actually all we need just delete the current broken file) 😀

done, it works for me.. hope for you too 🙂

Advertisements

Tagged: , , ,

§ 6 Responses to How to solve `cached_specs’: undefined method `spec’ for nil:NilClass error

  • rubytree says:

    You sometimes need to specify target path for bundle install command, that worked for me:
    bundle install $BUNDLER_PATH

  • matthew says:

    thanks, you saved my life!

  • liping says:

    thank you so much!

  • rohit says:

    Thanks, Worked but still I am getting some error. Can you please solve?

    [/home/rohit/.rvm/gems/ruby-1.9.3-p125@qnrDashboard/specifications/net-ssh-2.5.2.gemspec] isn’t a Gem::Specification (NilClass instead).

    [/home/rohit/.rvm/gems/ruby-1.9.3-p125@qnrDashboard/specifications/net-ssh-2.5.2.gemspec] isn’t a Gem::Specification (NilClass instead).

    [/home/rohit/.rvm/gems/ruby-1.9.3-p125@qnrDashboard/specifications/net-ssh-2.5.2.gemspec] isn’t a Gem::Specification (NilClass instead).

    Above errors occur before command (e.g rails s) and command executes successfully!

  • bigzaqui says:

    haha it worked! thanks!

  • טרול הבית says:

    Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading How to solve `cached_specs’: undefined method `spec’ for nil:NilClass error at Kubid on rails blog.

meta

%d bloggers like this: