gpt4 book ai didi

ruby - 如何在 vagrant 代理后面安装代理插件

转载 作者:可可西里 更新时间:2023-11-01 09:28:28 25 4
gpt4 key购买 nike

我在一个受限制的代理网络上工作,我目前有 vagrant 在笔记本电脑上工作。我不得不使用代理插件,而且我不得不从我的工作网络中安装它。

我现在在桌面上 - 这是不可能的(在 Windows 上),我正在尝试配置 vagrant。我怀疑我应该输入的命令是:

vagrant plugin install --plugin-source http://rubygems.org vagrant-proxyconf

这是报告:

Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

Could not fetch specs from http://gems.hashicorp.com/

Warning: this Gemfile contains multiple primary sources. Using `source`
more than once without a block is a security risk, and may result in
installing unexpected gems. To resolve this warning, use a block to
indicate which gems should come from the secondary source. To upgrade
this warning to an error, run `bundle config disable_multisource true`.

我假设这与代理问题有关。我已经尝试了 cmdPowerShell 以及

设置http_proxy=xxxxx:80

有什么建议吗?如果可能的话,我很乐意进行手动安装。

谢谢!

最佳答案

需要在Vagrant宿主机中设置代理环境变量,使其知道如何下载插件。

例如:

$ export http_proxy=http://192.0.2.1:3128
$ export https_proxy=http://192.0.2.1:3128

$ env | grep http # just checking
http_proxy=http://192.0.2.1:3128
https_proxy=http://192.0.2.1:3128

$ vagrant plugin install vagrant-proxyconf
Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Installed the plugin 'vagrant-proxyconf (1.5.2)'!

关于ruby - 如何在 vagrant 代理后面安装代理插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33109186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com