Frage

I decided to clean up my development laptop in preparation for chef.

I ran:

gem clean
sudo gem clean
/usr/bin/gem list --no-versions | xargs sudo /usr/bin/gem uninstall -a

Then I noticed that I don't have ~/.bashrc so I ran

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc

~/.bashrc is a blank file otherwise. Next, I pull the rbenv git and ran:

rbenv install 2.1.0
rbenv rehash
rbenv global 2.1.0

ruby -v # ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
gem -v # 2.2.0

bundle install works fine in two projects after this.

Finally,

gem install knife-solo berkshelf --debug -V

produces

Exception `LoadError' at /home/mark/.rbenv/versions/2.2.0-dev/lib/ruby/2.2.0/resolv.rb:169 - LoadError
Exception `Errno::EEXIST' at /home/mark/.rbenv/versions/2.2.0-dev/lib/ruby/2.2.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /home/mark/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /home/mark/.rbenv/versions/2.2.0-dev/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:286 - No such file or directory @ rb_file_s_stat - /home/mark/.gem/specs/api.rubygems.org%443/latest_specs.4.8
GET https://api.rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/mark/.rbenv/versions/2.2.0-dev/lib/ruby/2.2.0/openssl/buffering.rb:182 - read would block 302 Moved Temporarily

OpenSSL seems to be installed fine and I can't seem to find any info on this error.

Environment: Ubuntu 13.10, Rails 4.0.0

War es hilfreich?

Lösung

This finally worked after I removed my ~/.rbenv folder and started again. I had previously removed the native system ruby using apt-get and I'm not sure if this was the error. I'm unsure if a system version of Ruby is required or not but it all worked after I used sudo apt-get install ruby.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top