Bundle Install无法从https://rubygems.org/获取spec

时间:2021-02-15 00:19:03

I'm attempting to follow the Hartl Rails Tutorial, and having trouble with the bundler gem.

我正在尝试遵循Hartl Rails教程,并且在bundler gem方面遇到了问题。

When using the commands 'bundle install' or 'bundle update' I get the following output:

当使用“bundle install”或“bundle update”命令时,我得到如下输出:

Fetching source index from https://rubygems.org/

从https://rubygems.org/获取源索引

Could not fetch specs from https://rubygems.org/

无法从https://rubygems.org/获取spec

I've searched for this output, but did not find many related issues online.

我已经搜索了这个输出,但是没有在网上找到很多相关的问题。

Maybe I have another gem that is interrupting bundler? I have little experience with rails at this point.

也许我有另一颗宝石打断了邦德勒?在这一点上,我几乎没有rails的经验。

    source 'https://rubygems.org'

gem 'rails', '3.2.12'

group :development do
  gem 'sqlite3', '1.3.5'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'

  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

The solution for me was two parts: I changed https to http, and that temporarily solved the issue. The second issue was that I think I had a bad install of ruby 2.0.0 even though I was using a fresh install of ruby 1.9.3. So I reinstalled ruby 2.0.0, and I could use bundle install with https.

我的解决方案分为两部分:我将https改为http,这暂时解决了问题。第二个问题是,我认为ruby 2.0.0的安装很糟糕,尽管我使用的是ruby 1.9.3的新安装。所以我重新安装了ruby 2.0.0,我可以使用https打包安装。

9 个解决方案

#1


7  

you can try the following, if in windows:

如果在windows中,您可以尝试以下操作:

set HTTP_PROXY=

设置HTTP_PROXY =

set HTTPS_PROXY=%HTTP_PROXY%

设置HTTPS_PROXY = % HTTP_PROXY %

For eg:

如:

HTTP_PROXY=mycompany.myproxy.com:8080

HTTP_PROXY = mycompany.myproxy.com:8080

HTTPS_PROXY=%HTTP_PROXY%

HTTPS_PROXY = % HTTP_PROXY %

Worked for me

为我工作

#2


2  

The other reason causing such that issues is the fact if you are behind proxy server. I describe here solution, maybe it will be usefull for someone else. :)

引起这种问题的另一个原因是如果您在代理服务器后面。我在这里描述的解决方案,可能对其他人有用。:)

In case that you did not know Login/pass for yours proxy, and meet this issues you could firstly check if you need to (re)install anything, by command:

如果您不知道您的代理的登录/通行证,并且满足这个问题,您可以先检查是否需要重新安装任何东西,通过命令:

C:\...> bundle check
Resolving dependencies...
The Gemfile's dependencies are satisfied

If you get other respons then above, you could find properly gems in properly versions here (rubygems.org), then install it (from the directory with downloaded gem) by command:

如果你在上面得到其他的重生,你可以在这里找到正确的宝石版本(rubygems.org),然后通过命令安装它(从下载的宝石目录):

gem install <gem-name> --locally 

#3


1  

I had the same issue using ruby-2.0.0-p247 on OS X 10.8.5.

我在OS X 10.8.5上使用ruby-2.0 -p247也有同样的问题。

Make sure the first line in Gemfile is using https://

确保Gemfile中的第一行使用https://

source 'https://rubygems.org'

I reinstalled that version of ruby.

我重新安装了那个版本的ruby。

rvm reinstall ruby-2.0.0

Ruby was upgraded ruby-2.0.0-p598 (version depends on latest patch).

Ruby升级了Ruby -2.0 -p598(版本取决于最新的补丁)。

bundle then worked without error although all the gems were reinstalled.

尽管所有的宝石都被重新安装了,但是bundle仍然正常工作。

#4


1  

I had this issue while working in Cloud 9. After trying several 'bundle install' and sending an email to c9 support(no reply) I was able to get it working by killing all the processes and doing a hard-restart of the IDE.

我在云9工作时遇到了这个问题。在尝试了几个“捆绑安装”并向c9 support发送了一封电子邮件(没有回复)之后,我通过终止所有进程并硬重启IDE,使它能够工作。

Do this by clicking directly on the little bar-graphs at the top of the right-hand side that show CPU, Memory, Disk. Then click on the process list, select them all, and force kill. Then exit out of the process list. Click on the bar-graphs again, and this time click 'Restart'.

通过直接单击右边顶部显示CPU、内存和磁盘的小条形图来实现这一点。然后点击过程列表,选择它们,然后强制杀戮。然后退出流程列表。再次单击条形图,这次单击“重新启动”。

After this I was able to run bundle with no problems.

在此之后,我可以毫无问题地运行bundle。

#5


1  

I had the same issue. The only working solution I found was to force http instead of https in Gemfile:

我有同样的问题。我发现的唯一可行的解决方案是在Gemfile中强制使用http而不是https:

source 'http://rubygems.org'

#6


0  

Adding variable for proxy worked fine.

为代理添加变量很有效。

Additionally if you are using Bitnami redmine like me you can add that into setenv.bat then when you start command line with Bitnami Redmine short cut it will be automatically added to your environment. You can find this under Bitnami installation folder.

另外,如果你像我一样使用Bitnami redmine,你可以将其添加到setenv中。然后,当您使用Bitnami Redmine short cut启动命令行时,它将自动添加到您的环境中。您可以在Bitnami安装文件夹下找到它。

#7


0  

If you are using Cloud9, just restart (command R) and try again

如果您正在使用Cloud9,只需重新启动(命令R)并再次尝试。

#8


0  

Sometimes it happens due to proxy you are using. I tried to resolve this by using a connection without proxy and all worked perfectly fine.
Then try:

有时它是由于您正在使用的代理而发生的。我试图通过使用一个没有代理的连接来解决这个问题,所有的工作都非常顺利。然后尝试:

bundle update

And then go for

然后去

bundle install

#9


0  

CHange your source form https to http after run

在运行后,将您的源格式转换为http。

sudo bundle update sudo bundle install

sudo包更新sudo包安装

#1


7  

you can try the following, if in windows:

如果在windows中,您可以尝试以下操作:

set HTTP_PROXY=

设置HTTP_PROXY =

set HTTPS_PROXY=%HTTP_PROXY%

设置HTTPS_PROXY = % HTTP_PROXY %

For eg:

如:

HTTP_PROXY=mycompany.myproxy.com:8080

HTTP_PROXY = mycompany.myproxy.com:8080

HTTPS_PROXY=%HTTP_PROXY%

HTTPS_PROXY = % HTTP_PROXY %

Worked for me

为我工作

#2


2  

The other reason causing such that issues is the fact if you are behind proxy server. I describe here solution, maybe it will be usefull for someone else. :)

引起这种问题的另一个原因是如果您在代理服务器后面。我在这里描述的解决方案,可能对其他人有用。:)

In case that you did not know Login/pass for yours proxy, and meet this issues you could firstly check if you need to (re)install anything, by command:

如果您不知道您的代理的登录/通行证,并且满足这个问题,您可以先检查是否需要重新安装任何东西,通过命令:

C:\...> bundle check
Resolving dependencies...
The Gemfile's dependencies are satisfied

If you get other respons then above, you could find properly gems in properly versions here (rubygems.org), then install it (from the directory with downloaded gem) by command:

如果你在上面得到其他的重生,你可以在这里找到正确的宝石版本(rubygems.org),然后通过命令安装它(从下载的宝石目录):

gem install <gem-name> --locally 

#3


1  

I had the same issue using ruby-2.0.0-p247 on OS X 10.8.5.

我在OS X 10.8.5上使用ruby-2.0 -p247也有同样的问题。

Make sure the first line in Gemfile is using https://

确保Gemfile中的第一行使用https://

source 'https://rubygems.org'

I reinstalled that version of ruby.

我重新安装了那个版本的ruby。

rvm reinstall ruby-2.0.0

Ruby was upgraded ruby-2.0.0-p598 (version depends on latest patch).

Ruby升级了Ruby -2.0 -p598(版本取决于最新的补丁)。

bundle then worked without error although all the gems were reinstalled.

尽管所有的宝石都被重新安装了,但是bundle仍然正常工作。

#4


1  

I had this issue while working in Cloud 9. After trying several 'bundle install' and sending an email to c9 support(no reply) I was able to get it working by killing all the processes and doing a hard-restart of the IDE.

我在云9工作时遇到了这个问题。在尝试了几个“捆绑安装”并向c9 support发送了一封电子邮件(没有回复)之后,我通过终止所有进程并硬重启IDE,使它能够工作。

Do this by clicking directly on the little bar-graphs at the top of the right-hand side that show CPU, Memory, Disk. Then click on the process list, select them all, and force kill. Then exit out of the process list. Click on the bar-graphs again, and this time click 'Restart'.

通过直接单击右边顶部显示CPU、内存和磁盘的小条形图来实现这一点。然后点击过程列表,选择它们,然后强制杀戮。然后退出流程列表。再次单击条形图,这次单击“重新启动”。

After this I was able to run bundle with no problems.

在此之后,我可以毫无问题地运行bundle。

#5


1  

I had the same issue. The only working solution I found was to force http instead of https in Gemfile:

我有同样的问题。我发现的唯一可行的解决方案是在Gemfile中强制使用http而不是https:

source 'http://rubygems.org'

#6


0  

Adding variable for proxy worked fine.

为代理添加变量很有效。

Additionally if you are using Bitnami redmine like me you can add that into setenv.bat then when you start command line with Bitnami Redmine short cut it will be automatically added to your environment. You can find this under Bitnami installation folder.

另外,如果你像我一样使用Bitnami redmine,你可以将其添加到setenv中。然后,当您使用Bitnami Redmine short cut启动命令行时,它将自动添加到您的环境中。您可以在Bitnami安装文件夹下找到它。

#7


0  

If you are using Cloud9, just restart (command R) and try again

如果您正在使用Cloud9,只需重新启动(命令R)并再次尝试。

#8


0  

Sometimes it happens due to proxy you are using. I tried to resolve this by using a connection without proxy and all worked perfectly fine.
Then try:

有时它是由于您正在使用的代理而发生的。我试图通过使用一个没有代理的连接来解决这个问题,所有的工作都非常顺利。然后尝试:

bundle update

And then go for

然后去

bundle install

#9


0  

CHange your source form https to http after run

在运行后,将您的源格式转换为http。

sudo bundle update sudo bundle install

sudo包更新sudo包安装