Vagrant issues

Hello!

I’m using Leap 15.0 (fresh install, I’ve never used opensuse before today) and i’ve tried to install and run vagrant. I used 1-click-installer for vagrant from here. It installed without any problems. Running *vagrant -v *gives following output:

Vagrant 2.1.2

However when I try to run any vagrant command (e.g. vagrant help or vagrant up) there is an error:

Traceback (most recent call last):
        8: from /usr/bin/vagrant:23:in `<main>'
        7: from /usr/bin/vagrant:23:in `load'
        6: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/bin/vagrant:85:in `<top (required)>'
        5: from /usr/lib64/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        4: from /usr/lib64/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        3: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/lib/vagrant.rb:313:in `<top (required)>'
        2: from /usr/lib64/ruby/2.5.0/pathname.rb:444:in `children'
        1: from /usr/lib64/ruby/2.5.0/pathname.rb:444:in `foreach'
/usr/lib64/ruby/2.5.0/pathname.rb:444:in `open': No such file or directory @ dir_initialize - /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins (Errno::ENOENT)

And directory */usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/ *does not have directory plugins. Moreover it does not have more directories presented at vagrant repository

  • plugins
  • templates
  • keys
  • test
  • website

It seems that it didn’t install something needed to run, but I have no idea how to fix it. Am I missing something? Should I get them from repository (however that just does not make sense to me)?
I’ve tried reinstalling package, but it does not help at all.

Thanks in advance

Looking at the RPM contents and the error, it’s pretty apparent that the core functionality is copied to a location that’s either not configured or can be fixed with the following command which symlinks the expected to the actual locations

Paste the following into an elevated console and execute

ln -s /usr/share/vagrant/plugins /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins && 
ln -s /usr/share/vagrant/templates /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/templates &&
ln -s /usr/share/vagrant/keys /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/keys

To my eye,
That should address the main functionality but does not address the “test” and “website” locations.
Both should be addressed, but by someone who knows how vagrant uses these files… The “test” files look like individual tests and the “website” files look like they’re used if you’re pushing to heroku.
So, I doubt that either of these are critical for all use, only useful for specific scenarios.

Bottom line is with the symlinks I provided, vagrant should work for almost all situations until this package is fixed officially.

In any case,
You should submit a bug to https://bugzilla.opensuse.org to have this package’s maintainer fix these things.
After you’ve done that (and you can reference this Forum thread in your bug report), you can post the bug issue number in this Forum.

TSU

Thank you, creating symlinks helped. However it gives following warning when running vagrant commands:

/usr/share/vagrant/plugins/commands/login/client.rb:8: warning: already initialized constant VagrantPlugins::LoginCommand::Client::APP
/usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins/commands/login/client.rb:8: warning: previous definition of APP was here

Which it is probably because of the symlinks. Anyways your solution at least makes vagrant usable.

I’ve created bug report for this problem - #1103043](https://bugzilla.opensuse.org/show_bug.cgi?id=1103043)

OK, thx for the feedback.

The alternative is to install from source. Looks pretty straightforward.
You would first need to install Ruby using a Ruby version manager, I recommend rbenv and created a Wiki page for doing this on openSUSE… My modification is to install so that any and every User(including root) can use the Ruby you install from the official Ruby repos whereas the official rbenv documentation installs only for the logged in User

https://en.opensuse.org/User:Tsu2/Install_Ruby

Then,
clone Vagrant from Github and follow the instructions for building (simple steps)

https://github.com/hashicorp/vagrant

The actual instructions to do this is the following page

https://www.vagrantup.com/docs/installation/source.html

TSU

Thank you!
I’ve installed vagrant from source and it is working like a charm. Will be using it until package is fixed.