Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails “是否有修复程序?”;在任何来源中都找不到“gem”;不符合';是否删除Gemfile.lock?_Ruby On Rails_Ruby On Rails 3 - Fatal编程技术网

Ruby on rails “是否有修复程序?”;在任何来源中都找不到“gem”;不符合';是否删除Gemfile.lock?

Ruby on rails “是否有修复程序?”;在任何来源中都找不到“gem”;不符合';是否删除Gemfile.lock?,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我正在尝试在一台新计算机上设置我的开发环境 git clone -o heroku git@heroku.com:theirapp.git cd theirapp bundle Fetching gem metadata from https://rubygems.org/...... Fetching gem metadata from https://rubygems.org/.. Could not find jquery-rails-2.0.0 in any of the sources

我正在尝试在一台新计算机上设置我的开发环境

git clone -o heroku git@heroku.com:theirapp.git
cd theirapp
bundle
Fetching gem metadata from https://rubygems.org/......
Fetching gem metadata from https://rubygems.org/..
Could not find jquery-rails-2.0.0 in any of the sources

谷歌搜索此错误后,响应似乎是删除
Gemfile.lock
,然后再次运行
bundle
。这是可行的,但是我有不同版本的gems,我没有在
Gemfile
中指定版本。有没有办法在不删除
Gemfile.lock
的情况下修复此错误?我使用的是Rails 3.2和Ruby 1.9.3。

根据rubygems.org,jquery Rails 2.0.0已经过测试。这就解释了jQueryRails的错误


运行
$bundle update jquery rails
将重建您的gem快照。这样你就不必删除Gemfile.lock了,我发现指定gem版本总是最安全的,只有在必要的时候才能更改它们。为我省去了很多麻烦。

bundle update jquery rails
将只更新
jquery rails
gem,这很可能就是您想要的。运行
bundle update
相当于删除
Gemfile.lock
,在大多数情况下不建议这样做。请看这里:

一个旧版本的bundler给了我同样的问题。经过一番困惑之后,我意识到这就是问题所在

运行
gem安装bundler
将其完全修复。

只需运行即可

bundle --full-index

这应该可以解决问题

但这会更新我所有没有指定版本的gem,对吗?这就是我试图避免的。您可以使用$bundle update只更新特定的gem。这个答案应该更新以反映这样一个事实,即直接运行
bundle update
通常是一个坏主意。它本质上与删除Gemfile.lock完全相同。看这里:看。被接受的答案与这个答案相似,也很危险,所以请检查其他答案。是的,这也是我一直在寻找的。我最近发布了一个gem,遇到了“notfound”错误。谢谢这有什么用
bundle--help
没有为
--full index
@johnsimer列出选项,因为选项
--full index
使用现代索引而不是API端点。出于某种原因,这比没有该选项更详尽