草庐IT

windows - vagrant-proxyconf "` 拆分': bad URI"error on installing plugin for Vagrant

coder 2024-06-08 原文

请注意,我在 Windows 环境中运行它。

我在公司代理后面工作,并试图获得 vagrant-proxyconf插件工作,因此可以将 Vagrant 机器设置为通过代理工作。但是,在执行 vagrant plugin install vagrant-proxyconf 时,出现以下错误:

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/

Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/

认为这可能是代理问题,我尝试设置我的环境变量:

设置 HTTP_PROXY="http://username:password@proxy:port"

重新执行插件安装命令后,出现不同的错误:

C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(is not
URI?): http://"http://username:password@proxy:port" (URI::InvalidURIError)
        from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:211:in `parse'
        from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
        from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:996:in `URI'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:908:in `proxy_from_env'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:858:in `proxy='
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:528:in `initialize'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
113:in `new'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
113:in `connection'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
103:in `initialize'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `new'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `block in remote_specs'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `map'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `remote_specs'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:202:in `fetch_specs'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:66:in `specs'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:216:in `block (2 levels) in index'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:213:in `each'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:213:in `block in index'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/index.rb:9:
in `build'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:209:in `index'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:203:in `resolve'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:133:in `specs'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:122:in `resolve_remotely!'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/installer.r
b:76:in `run'
        from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/installer.r
b:15:in `install'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
226:in `block in internal_install'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
284:in `block in with_isolated_gem'
        from C:/Vagrant/embedded/lib/ruby/2.0.0/rubygems/user_interaction.rb:40:
in `use_ui'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
283:in `with_isolated_gem'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
225:in `internal_install'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
92:in `install'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:62:in `block in install_plugin'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:72:in `call'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:72:in `install_plugin'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/action/install_gem.rb:37:in `call'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/ward
en.rb:34:in `call'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/buil
der.rb:116:in `call'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runn
er.rb:66:in `block in run'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/util/busy.r
b:19:in `busy'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runn
er.rb:66:in `run'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/base.rb:14:in `action'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:32:in `block in execute'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:31:in `each'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:31:in `execute'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/root.rb:56:in `execute'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/cli.rb:42:i
n `execute'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment
.rb:292:in `cli'
        from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:174:in `<ma
in>'

注意错误: C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in 'split': 错误的 URI(不是 URI?):http://"http://username :password@proxy:port"(URI::InvalidURIError) 来自 C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:211:in parse'

它似乎错误地解释了环境变量并且在解释它时遇到问题?有人知道如何解决这个问题吗?

最佳答案

您可能甚至不需要引号(除非密码包含一些有趣的字符)。所以你可以试试:

set HTTP_PROXY=http://username:password@proxy:port

如果您需要引号,正确的形式是:

set "HTTP_PROXY=http://username:password@proxy:port"

关于windows - vagrant-proxyconf "` 拆分': bad URI"error on installing plugin for Vagrant,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26414803/

有关windows - vagrant-proxyconf "` 拆分': bad URI"error on installing plugin for Vagrant的更多相关文章

  1. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  2. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  3. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  4. ruby-on-rails - 'compass watch' 是如何工作的/它是如何与 rails 一起使用的 - 2

    我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t

  5. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  6. ruby-on-rails - Rails 3.2.1 中 ActionMailer 中的未定义方法 'default_content_type=' - 2

    我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer

  7. ruby - 在 jRuby 中使用 'fork' 生成进程的替代方案? - 2

    在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',

  8. ruby - 主要 :Object when running build from sublime 的未定义方法 `require_relative' - 2

    我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby​​1.9+ 关于ruby-主要:Objectwhenrun

  9. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

  10. ruby - 如何在 Ruby 中拆分参数字符串 Bash 样式? - 2

    我正在为一个项目制作一个简单的shell,我希望像在Bash中一样解析参数字符串。foobar"helloworld"fooz应该变成:["foo","bar","helloworld","fooz"]等等。到目前为止,我一直在使用CSV::parse_line,将列分隔符设置为""和.compact输出。问题是我现在必须选择是要支持单引号还是双引号。CSV不支持超过一个分隔符。Python有一个名为shlex的模块:>>>shlex.split("Test'helloworld'foo")['Test','helloworld','foo']>>>shlex.split('Test"

随机推荐