Petar Petrović
Petar Petrović

Reputation: 13

RubyGems issue on OS X Lion

I created a new RoR application, but whenever I run bundle install (which installs RSpec along other gems) I get the following error:

Gem::Package::FormatError: no metadata found in /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem An error occured while installing selenium-webdriver (2.22.0), and Bundler cannot continue. Make sure that gem install selenium-webdriver -v '2.22.0' succeeds before bundling.

When I run gem install selenium-webdriver -v '2.22.0', I get the following error message:

ERROR: Error installing selenium-webdriver: invalid gem format for /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem

I tried manually removing the gem from cache folder and then rerun bundle install but I still get the same error messages.

Any ideas how to fix this?

Upvotes: 1

Views: 1331

Answers (3)

Rupali
Rupali

Reputation: 321

Remove the cached copy of the gem and then try installing it again

rm -rf /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
gem install selenium-webdriver -v '2.22.0'

Upvotes: 0

u19964
u19964

Reputation: 3345

I don't quite understand the above solution although it might work for someone. I ran into the same error but with different gem. I got problem with nokogiri and got this error message:

Gem::Package::FormatError: no metadata found in /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/nokogiri-1.5.5.gem

I went to /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/ and removed the file nokogiri-1.5.5.gem and I was able to run bundle again. I think there is something messed up with the .gem file.

Upvotes: 1

Alexander
Alexander

Reputation: 1329

Update gems

gem update --system
gem update

Check Gemfile in your rails application. Should content: gem "selenium-webdriver", "~> 2.22.0"

Run bundle install again.

Upvotes: 4

Related Questions