ruby-on-rails – gem install异常`OpenSSL :: SSL :: SSLErrorWaitReadable’读取会阻塞

我决定清理我的开发笔记本电脑,为厨师做准备.

我跑了:

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

然后我注意到我没有〜/ .bashrc所以我跑了

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

〜/ .bashrc是一个空白文件.接下来,我拉rbenv git并运行:

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

捆绑安装在此之后的两个项目中工作正常.

最后,

gem install knife-solo berkshelf --debug -V

产生

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似乎安装得很好,我似乎无法找到有关此错误的任何信息.

环境:Ubuntu 13.10,Rails 4.0.0

最佳答案 在我删除〜/ .rbenv文件夹并重新启动后,这终于奏效了.我之前使用apt-get删除了本机系统ruby,我不确定这是不是错误.我不确定是否需要系统版本的Ruby,但是在我使用sudo apt-get install ruby​​之后它都运行了.

点赞