Error trying to install vagrant-aws

1,406 views
Skip to first unread message

Jeff Sussna

unread,
Mar 14, 2013, 2:18:32 PM3/14/13
to vagra...@googlegroups.com
Installed Vagrant 1.1 on Ubuntu. Running 'sudo vagrant plugin install vagrant-aws' returns:

/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:562:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /opt/vagrant/embedded/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.


Ruby version is 1.9.3p0. Note that I am not a Ruby expert, so entirely possible I'm missing something I need at the Ruby level. Be gentle :-).

Mitchell Hashimoto

unread,
Mar 14, 2013, 2:31:23 PM3/14/13
to vagra...@googlegroups.com
Hrm. I package libxml2 with the Vagrant 1.1 installers but maybe its not working on Ubuntu. 

You can install libxml2/libxslt (and the -dev packages) on your own machine to get it working.




--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeff Sussna

unread,
Mar 14, 2013, 2:38:00 PM3/14/13
to vagra...@googlegroups.com
How do I do that?

André Lima

unread,
Mar 14, 2013, 2:39:26 PM3/14/13
to vagra...@googlegroups.com
sudo apt-get install libxml2
--
Atenciosamente,

André Lima

Mitchell Hashimoto

unread,
Mar 14, 2013, 2:40:31 PM3/14/13
to vagra...@googlegroups.com
You need to install the dev versions to. The guide here is good: 

Jeff Sussna

unread,
Mar 14, 2013, 2:48:21 PM3/14/13
to vagra...@googlegroups.com
Followed both of your instructions. Made no difference.

Jeff Sussna

unread,
Mar 14, 2013, 3:12:35 PM3/14/13
to vagra...@googlegroups.com
With a minor edit to the Gemfile I was able to build and test the plugin locally. When I try to run it via bundle exec vagrant up --provider=aws, with a Vagrantfile copied from the vagrant-aws README.md, I get:

Vagrant failed to initialize at a very early stage:

There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:

/home/jeffsussna/.bundler/ruby/1.8/vagrant-194948999371/config/default.rb:22: syntax error, unexpected ':', expecting kEND
    guest: 22,
          ^
/home/jeffsussna/.bundler/ruby/1.8/vagrant-194948999371/config/default.rb:24: syntax error, unexpected ',', expecting kEND

Mitchell Hashimoto

unread,
Mar 14, 2013, 3:26:05 PM3/14/13
to vagra...@googlegroups.com
Jeff,

Vagrant only works with Ruby 1.9 now.

Best,
Mitchell


Message has been deleted

Jeff Sussna

unread,
Mar 14, 2013, 3:43:08 PM3/14/13
to vagra...@googlegroups.com
No idea why bundle exec is using 1.8. ruby -v returns 1.9.3, and I followed the vagrant-aws development instructions on Github.

Nilesh

unread,
Mar 14, 2013, 3:45:32 PM3/14/13
to vagra...@googlegroups.com
Please edit gemfile to force bundler to use 1.9.3


source "https://rubygems.org"
ruby "1.9.3"
# ...

Jeff Sussna

unread,
Mar 14, 2013, 4:04:49 PM3/14/13
to vagra...@googlegroups.com
"Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3"

ruby -v returns 1.9.3. Vagrant itself runs just fine.

Nilesh

unread,
Mar 14, 2013, 4:22:29 PM3/14/13
to vagra...@googlegroups.com
I would begin by checking the path to rubies on your system. What's the os environment. Did you install ruby? If so, how? used rbenv or rvm?

Jeff Sussna

unread,
Mar 14, 2013, 4:56:41 PM3/14/13
to vagra...@googlegroups.com
Ubuntu 12.04 LTS. Came with 1.8.7 IIRC. I installed 1.9.1 (apt-get). Had rvm running at one point but didn't work with that so I ripped it out. Probably left a clamp or two inside the chest cavity when I did :-).

Is there a clean way to 'start over' re Ruby install/config/gems/etc.? Get rid of 1.8.7 altogether?

Nilesh

unread,
Mar 14, 2013, 5:50:15 PM3/14/13
to vagra...@googlegroups.com
I would ignore the system rubies and the apt-get partial(?) ruby you got. Instead I would try salvaging by using rbenv on the lines of https://gist.github.com/MicahElliott/2407918 

Watch out for $PATH carefully so you know rbenv rubies take precedence over system and other rubies. 

Jeff Sussna

unread,
Mar 15, 2013, 10:12:37 AM3/15/13
to vagra...@googlegroups.com
This guide seems to refer to 1.8 versions. Should I be using 1.9 versions instead?

Jeff Sussna

unread,
Mar 15, 2013, 11:15:08 AM3/15/13
to vagra...@googlegroups.com
I burned my ruby environment to the ground and started over. Everything seems to use 1.9.1 now. Vagrant 1.1 runs fine, nokogiri builds fine, so I'm assuming dev tools are properly installed. Still have the same problem trying to install vagrant-aws provider. 'bundle exec vagrant up --provider=aws' when run from the directory where I cloned and built the provider returns 'provider aws could not be found'.

At this point I am declaring myself dead in the water.

Jeff Sussna

unread,
Mar 15, 2013, 11:43:08 AM3/15/13
to vagra...@googlegroups.com
Figured out the 'bundle exec vagrant up' problem. Instructions in Github omit need for 'Vagrant.require_plugin "vagrant-aws"' in Vagrantfile.

Jeff Sussna

unread,
Mar 15, 2013, 5:20:47 PM3/15/13
to vagra...@googlegroups.com
I tipped up a virgin Ubuntu box inside of Vagrant, installed and ran Vagrant 1.1 and vagrant-aws inside of it. Worked like a charm. So must just be effed-up Ruby environment on my machine. FWIW after installing Vagrant 1.1. virgin box still thinks it doesn't have Ruby.

Nilesh L

unread,
Mar 15, 2013, 5:25:49 PM3/15/13
to vagra...@googlegroups.com
Getting latest rubies right is key :)

Mark Waddle

unread,
Mar 16, 2013, 6:06:05 PM3/16/13
to vagra...@googlegroups.com
What worked for me without hiccups on Ubuntu 12.04 was to:
  1. uninstall the old version of vagrant that I had previously installed as a global gem (sudo gem uninstall vagrant)
  2. install vagrant using the deb file from the downloads (sudo dpkg -i vagrant*.deb) .. this installs an "embedded" ruby/gem/etc that have the correct versions for vagrant
  3. ensure that the version of vagrant you are executing when calling vagrant is the new one (which vagrant) ... should be /usr/bin/vagrant that is bash script that executes /opt/vagrant/bin/vagrant
  4. install vagrant plugins without sudo (vagrant plugin install vagrant-aws) ... this uses the embedded gem and installs under your ~/.vagrant.d/ directory
This way your ruby environment is left untouched and vagrant has its own private copy of everything.

Cheers,
Mark
Reply all
Reply to author
Forward
0 new messages