Bundle安装尝试使用缓存文件 [英] Bundle install tries to use cache file
问题描述
当我尝试执行捆绑安装时,我的gem_path和gem_home指向/ usr / local / rvm / gems /,我没有写入权限,并且因无效权限而失败。因为这我已经改变了两个路径到本地目录,我有写权限。
当我这样做,我做一个捆绑安装,我得到:
p> bruno @ test6:〜$ bundle install
从https://rubygems.org / ....获取gem元数据.....
从https://rubygems.org/获取gem元数据..
Bundler :: GemspecError:无法读取/afs/varda.io/user/中的gem b / BR /布鲁诺/ TEST6 /缓存/耙10.1.0.gem。它可能已损坏。
安装rake(10.1.0)时发生错误,并且Bundler无法继续。
确保在捆绑之前,gem install rake -v '10.1.0'`成功。
好吧,如果我做了一个gem install,它就可以工作了。
但捆绑不起作用;即使尝试删除它所抱怨的缓存文件夹。
我尝试了bundle install --no-cache,它以相同的方式失败。 (bundle install --deployment也能正常工作)我如何获得bundle install的工作?
我花了相当长的时间,如果任何人有任何指导,我真的很感激它!
好的,首先,您可以通过使用rvm(user安装),请参阅 http://rvm.io ,如果这不是一个选项,您可以尝试使用项目特定的gem路径。
例如我有以下的Bundler配置文件(〜/ .bundle / config
)
---
BUNDLE_PATH:.bundle
BUNDLE_DISABLE_SHARED_GEMS:1
这会导致bundler将所有gem安装在 .bundle
子目录中(在您的项目文件夹内,运行 bundle install
)。现在,如果你记得为你的垃圾箱(例如cap(istrano))使用 bundle exec
,那你还好。
如果你以某种方式打开了你的bundler / cache,请尝试删除 .bundle
文件夹(在你的项目文件夹中)
When i try to do bundle install, my gem_path and gem_home point to /usr/local/rvm/gems/ which i don't have write access and it fails because of invalid permissions. because of this i've changed both paths to a local directory where i do have write access.
when doing so, i do a bundle install, i get :
bruno@test6:~$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Bundler::GemspecError: Could not read gem at /afs/varda.io/user/b/br/bruno/test6/cache/rake-10.1.0.gem. It may be corrupted.
An error occurred while installing rake (10.1.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.0'` succeeds before bundling.
well, if i do a gem install, it works just fine.
but bundle would just not work; even if a try to delete the cache folder that it complains about.
i did try "bundle install --no-cache" and it fails in the same way. (bundle install --deployment works fine too) how do i get bundle install to work ?
i've spent quite a bit of time, if anyone would have any guidance , i would really appreciate it!
okay, first of all, you could solve all this issues easily by using rvm (user installation), see http://rvm.io, if that is not an option, you could try using project-specific gem paths.
for example i have the following bundler config file (~/.bundle/config
)
---
BUNDLE_PATH: .bundle
BUNDLE_DISABLE_SHARED_GEMS: "1"
which causes bundler to install all gems in a .bundle
sub directory (inside your project folder, where you run bundle install
). now, if you remember to use bundle exec
for your bins (e.g. cap(istrano)), you're fine.
if you somehow f*cked up your bundler / cache, try deleting the .bundle
folder (in your project folder)
这篇关于Bundle安装尝试使用缓存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!