Page MenuHomePhabricator

Unprivileged user can't install nokogiri gem so setup.sh fails
Closed, DeclinedPublic

Description

Output from setup.sh and gem install nokogiri -v '1.6.3.1'

When I try to run the setup script of vagrant for the first time I get an error telling me bundler had a problem (see attachment for output). It says to make sure gem install nokogiri -v '1.6.3.1' executes without any errors. So I run gem install nokogiri -v '1.6.3.1' and see that my unprivileged user doesn't have access to some gem files. I could run these commands as root but then vagrant would be installed for root and wouldn't be able to access virtualbox. The only thing I can do is temporarily chmod those files into being able to be accessed by anyone. Installing the mediawiki-vagrant plugin (separately) works as expected. openSUSE 13.1
Vagrant 1.6.3
ruby 2.0.0p247 (2013-06-27) [x86_64-linux]


Version: unspecified
Severity: major
OS: Linux
Platform: PC
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=68453

Attached:

Details

Reference
bz69052

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:30 AM
bzimport set Reference to bz69052.

Similar problems were reported in bug 68453. We eventually closed that as "works for me", but the original reporter mentioned that they had to use sudo to get the install to complete.

I have installed everything using root (su instead of sudo but that shouldn't matter) but that installs everything under root which can't access virtualbox.

nokogiri is not a direct requirement of the vagrant-vbguest plugin. I'm not exactly sure what is causing it to be installed/updated by the plugin install. Maybe Dan can provide more insight on the ruby mechanisms involved. I believe that this is something which has changed in the installation requirements of the vagrant-vbguest plugin within the 4-6 weeks. The plugin itself has not been updated for some time, so I must be related to a updated dependency.

One thing we could think about is finding a way to reinstate the bundled version of the plugin from Ib2efe79591c5c2f12833068fbe777831cb15f167. This is likely blocked on Vagrant upstream restoring a means of running plugins without installing them however.

Output of nokogiri under root

Attached:

Installing nokogiri and vagrant-vbguest works:
linux-c6mg:/home/jamison # vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

(In reply to Jamison Lofthouse from comment #5)

Installing nokogiri and vagrant-vbguest works:
linux-c6mg:/home/jamison # vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

I forgot to mention that that is under root.

I guess mediawiki-vagrant isn't installing. I now get this:
jamison@linux-c6mg:~/vagrant> vagrant plugin install mediawiki-vagrant
Installing the 'mediawiki-vagrant' plugin. This can take a few minutes...
The plugin 'mediawiki-vagrant' could not be installed because it could not
be found. Please double check the name and try again.

(In reply to Jamison Lofthouse from comment #7)

jamison@linux-c6mg:~/vagrant> vagrant plugin install mediawiki-vagrant

The mediawiki-vagrant plugin is not published in a way that is compatible with this particular install command. It can instead be installed via:

$ gem build mediawiki-vagrant.gemspec
$ vagrant plugin install mediawiki-vagrant-<VERSION>.gem

So I got the mediawiki-vagrant plugin installed. Now it wants me to install NFS. openSUSE doesn't have an nfsd package but it does have a nfs-kernel-server package and I already installed it. What do I still need to install?

(In reply to Jamison Lofthouse from comment #9)

So I got the mediawiki-vagrant plugin installed. Now it wants me to install
NFS. openSUSE doesn't have an nfsd package but it does have a
nfs-kernel-server package and I already installed it. What do I still need
to install?

I think these instructions https://en.opensuse.org/SDB:Network_file_system may help. Be aware that older versions of the Vagrant application had issues with OpenSUSE and NFS https://github.com/mitchellh/vagrant/issues/2923 but I believe that this has been corrected in Vagrant 1.6.3.

I actually was reading both of those sites. The openSUSE documentation isn't very helpful because its just explaining how to configure it (vagrant should do that) and I looked it the file that was changed in the GitHub bug and the files are way different. They must have been significantly changed between releases.

It seems my nfs and nfsserver services aren't running. I tried starting them and now I get "Could not bind socket: (98) Address already in use".

I guess that error was because I was trying to start nfs when it was already start because it started working after a reboot. Vagrant now works. So it seem vagrant can work when the vagrant-vbguest is broken.

There is an upstream bug report at https://github.com/mitchellh/vagrant/issues/3769 . It seems that this may be an artifact of a particular broken version of the nokogiri gem.

I have the same problem, but with clean installation.

(Copied from Bug 68453 comment #15)

I ran into a similar problem with a clean install on OS X 10.9.4. I finally
got it working by first installing libiconv from source, and then pointing
nokogiri to the libxml2 that came with XCode and telling nokogiri install to
use system libraries:

$ sudo /Applications/Vagrant/embedded/bin/gem install --install-dir
~/.vagrant.d/gems nokogiri -v '1.6.3.1' --
--with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/
MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2
--use-system-libraries

I had this problem again while installing a random Vagrant plugin (https://github.com/dergachev/vagrant-vbox-snapshot) and was able to work around it using the advice from comment #17. I did not need to use sudo.

$ /Applications/Vagrant/embedded/bin/gem install --install-dir ~/.vagrant.d/gems nokogiri -v '1.6.3.1' -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 --use-system-libraries --no-ri --no-rdoc

This problem is caused by ruby and system library issues on OSX and is not specific to MediaWiki-Vagrant. Closing this issue as WONTFIX but hoping that the workarounds documented here can be found and used by anyone who happens to run into the problem in the future.