简体   繁体   English

gem install bundler无法正常工作?

[英]gem install bundler not working?

I'm new to ruby and working on my first project in ruby on rails. 我是红宝石的新手,正在从事我在铁路上的红宝石的第一个项目。 I followed the instruction given here to install ruby on my Ubuntu 14.04(by building from source). 我按照此处给出的说明在我的Ubuntu 14.04上安装ruby(通过源代码构建)。 It worked fine on my desktop. 在我的桌面上运行正常。 But after installing ruby on my Laptop 但是在我的笔记本电脑上安装了红宝石后

I'm getting error in installing bundler through gem. 通过gem安装捆绑程序时出现错误。 Here is what I did 这是我所做的

  1. First I tried installing it by typing gem install bundler -V , The output was: 首先,我尝试通过输入gem install bundler -V ,输出为:

    HEAD https://rubygems.org/api/v1/dependencies 200 OK GET https://rubygems.org/api/v1/dependencies?gems=bundler 200 OK ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/local/lib/ruby/gems/2.2.0 directory.

  2. Then I tried sudo gem install bundler -V and the output is: 然后我尝试了sudo gem install bundler -V ,输出为:

    ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/specs.4.8.gz)

Here are some other details that might help: 这里有一些其他细节可能会有所帮助:

  1. OS - Ubuntu 14.04 操作系统-Ubuntu 14.04
  2. I'm using internet behind an authenticated proxy. 我在经过身份验证的代理后面使用互联网。
  3. Ruby version: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] Ruby版本: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
  4. Rubygems version: 2.4.6 Rubygems版本: 2.4.6
  5. OPENSSL version by typing: ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION' : "OpenSSL 1.0.1f 6 Jan 2014" 键入以下内容的OPENSSL版本: ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'"OpenSSL 1.0.1f 6 Jan 2014"
  6. output of the command openssl s_client -showcerts -connect rubygems.org:https : gethostbyname failure connect:errno=11 命令的输出openssl s_client -showcerts -connect rubygems.org:https gethostbyname failure connect:errno=11

Thanks in advance. 提前致谢。

Try updating your certs. 尝试更新您的证书。

$ curl http://curl.haxx.se/ca/cacert.pem \
> $(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')

Credit here: http://ga.be/blog/2013/10/02/fixing-rubygems-ssl-issues-certificate-verify-failed/ 信用在这里: http//ga.be/blog/2013/10/02/fixing-rubygems-ssl-issues-certificate-verify-failed/

If you run into other issues building from source, you may want to try ruby-build which is terrific IMHO because it downloads the various dependencies easily. 如果您遇到其他从源代码构建的问题,则可能要尝试使用ruby-build ,这是很棒的恕我直言,因为它可以轻松下载各种依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM