[英]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
这是我所做的
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.
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: 这里有一些其他细节可能会有所帮助:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
2.4.6
2.4.6
ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
: "OpenSSL 1.0.1f 6 Jan 2014"
ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
: "OpenSSL 1.0.1f 6 Jan 2014"
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.