Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RoR -- NoMethodError: private method `open' called for Gem::Package:Class

Hey does anyone know what this error message means? I installed ruby from source then proceeded to install rubygems, and then installed rails via gem install rails

After creating a new project, I did a bundle install and got this error:

mark@mark-laptop:~/guide/first_app$ sudo bundle install Fetching source index for https://rubygems.org/

NoMethodError: private method open' called for Gem::Package:Class An error occured while installing rake (0.9.2.2), and Bundler cannot continue. Make sure thatgem install rake -v '0.9.2.2'` succeeds before bundling.

I did that command (gem install rake -v '0.9.2.2') and it worked fine.. I'm rather confused

like image 305
joslinm Avatar asked Feb 09 '12 00:02

joslinm


3 Answers

Try gem install bundler to install/update bundler after installing/updating rubygems.

It worked for me when I had your problem.

like image 148
Johan Alkstål Avatar answered Nov 09 '22 15:11

Johan Alkstål


This appears to be a bug in the master branch of rubygems from GitHub. If you grab an archive of 1.8.24 from http://rubygems.org/pages/download instead, everything works fine.

like image 3
wbond Avatar answered Nov 09 '22 14:11

wbond


I have rubygems 2.0.3 and I get the same error. I deleted gemfile.lock file in the project. Only change I got in error is From Make sure that gem install rake -v '0.9.2.2' succeeds before bundling. Changed to Make sure that gem install rake -v '10.0.3' succeeds before bundling. The new gem install rake also worked for me.

like image 3
sidnc86 Avatar answered Nov 09 '22 15:11

sidnc86