如何在win8上安装vagrant插件

时间:2015-09-04 10:33:41

标签: gem vagrant virtualbox

我在windows上安装了vagrant(1.7.4)和virtualbox(5.0.2),然后我下载了exact32.box并将其放入名为vag_pre的文件夹中。在我进入此命令行后:vagrant up,它发生了警告。这是代码:

Think@RESEARCH E:\vag_pre
$ vagrant box add base precise32.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'base' (v0) for provider:
    box: Unpacking necessary files from: file://E:/vag_pre/precise32.box
    box: Progress: 100% (Rate: 2588k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'base' (v0) for 'virtualbox'!

Think@RESEARCH E:\vag_pre
$ ls
precise32.box

Think@RESEARCH E:\vag_pre
$ vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

Think@RESEARCH E:\vag_pre
$ ls
precise32.box  Vagrantfile

Think@RESEARCH E:\vag_pre
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'base'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vag_pre_default_1441356586862_57133
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 4.2.0
    default: VirtualBox Version: 5.0
==> default: Mounting shared folders...
    default: /vagrant => E:/vag_pre

Think@RESEARCH E:\vag_pre
$ vagrant plugin update vagrant-vbguest
Updating plugins: vagrant-vbguest. This may 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:

An error occurred while installing little-plugger (1.1.4), and Bundler cannot continue.
Make sure that `gem install little-plugger -v '1.1.4'` succeeds before bundling.

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`.Gem::RemoteFetcher::FetchError: Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. - SSL_connect (https://rubygems.org/gems/little-plugger-1.1.4.gem)

我不知道如何在win8.1上安装gem,我应该先安装ruby吗?非常感谢

1 个答案:

答案 0 :(得分:1)

要安装新插件,您需要运行vagrant plugin install vagrant-vbguest

因为您似乎遇到了与https://rubygems.org的ssl连接问题,您应该添加以下参数:

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