更新Gemfile.lock失败

时间:2017-07-05 14:09:35

标签: ruby rubygems bundler

我已在Gemfile更新了宝石版本,因此我正在尝试更新Gemfile.lock。我跑:

$ bundle update
Fetching gem metadata from https://rubygems.org/......
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies.......
Fetching rake 10.5.0
Fetching i18n 0.8.1
Fetching minitest 5.7.0
Fetching thread_safe 0.3.6
....

并获得以下错误,尽管它似乎已被取出(参见上面的输出):

Bundler::GemspecError: Could not read gem at /usr/lib/ruby/gems/2.4.0/cache/rake-10.5.0.gem. It may be corrupted.
An error occurred while installing rake (10.5.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.5.0'` succeeds before bundling.

/usr/lib/ruby/gems/2.4.0/cache/下没有此类文件。缓存目录是可写的(777)。

如果我运行gem install rake -v '10.5.0'它运行正常。但是我真的需要手动安装gems(其他包的错误重复)吗?如果只是在没有更新宝石的情况下运行bundle install,我就不会遇到这样的错误。

1 个答案:

答案 0 :(得分:0)

原来,在void movetruck(osg::ref_ptr<osg::PositionAttitudeTransform> land, osg::ref_ptr<osg::PositionAttitudeTransform> truck, osg::ref_ptr<osg::Node> ob1, osg::ref_ptr<osg::Node> ob2) { osg::Vec3d trPos = truck->getPosition(); if ("must be true if both ob1 and ob2 are intersected") { trPos[2] += 0.01; }else{ trPos[0] += 0.01; } truck->setPosition(trPos); } 目录(cache)上设置写权限是不够的。您必须为父目录(/usr/lib/ruby/gems/2.4.0/cache/)设置写入权限。出于某种原因,/usr/lib/ruby/gems/2.4.0/不会写入bundle update,除非您这样做,即使它没有将任何内容写入与cache相同级别的任何其他目录。