hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.01k stars 4.42k forks source link

Every command returns error "cannot load such file -- vagrant (LoadError)" #13366

Open ItsNothingReally opened 3 months ago

ItsNothingReally commented 3 months ago

Hello team. I am running Arch Linux and have recently installed Vagrant through paru. Unfortunately, any command I try to run results in the below output.

Ignoring bcrypt_pbkdf-1.1.0 because its extensions are not built. Try: gem pristine bcrypt_pbkdf --version 1.1.0 Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1 Ignoring bootsnap-1.16.0 because its extensions are not built. Try: gem pristine bootsnap --version 1.16.0 Ignoring date-3.3.4 because its extensions are not built. Try: gem pristine date --version 3.3.4 Ignoring date-3.3.3 because its extensions are not built. Try: gem pristine date --version 3.3.3 Ignoring debug-1.7.2 because its extensions are not built. Try: gem pristine debug --version 1.7.2 Ignoring ed25519-1.3.0 because its extensions are not built. Try: gem pristine ed25519 --version 1.3.0 Ignoring ffi-1.16.3 because its extensions are not built. Try: gem pristine ffi --version 1.16.3 Ignoring io-console-0.6.0 because its extensions are not built. Try: gem pristine io-console --version 0.6.0 Ignoring json-2.7.1 because its extensions are not built. Try: gem pristine json --version 2.7.1 Ignoring msgpack-1.7.0 because its extensions are not built. Try: gem pristine msgpack --version 1.7.0 Ignoring nio4r-2.5.9 because its extensions are not built. Try: gem pristine nio4r --version 2.5.9 Ignoring puma-5.6.5 because its extensions are not built. Try: gem pristine puma --version 5.6.5 Ignoring racc-1.6.2 because its extensions are not built. Try: gem pristine racc --version 1.6.2 Ignoring vagrant-2.4.1 because its extensions are not built. Try: gem pristine vagrant --version 2.4.1 Ignoring wdm-0.1.1 because its extensions are not built. Try: gem pristine wdm --version 0.1.1 Ignoring websocket-driver-0.7.5 because its extensions are not built. Try: gem pristine websocket-driver --version 0.7.5

<internal:/home/thilo/.rbenv/versions/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in 'require': cannot load such file -- vagrant (LoadError) from <internal:/home/thilo/.rbenv/versions/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require' from /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/bin/vagrant:111:in 'main>'

Expected behavior

The vagrant command should run without issue.

Actual behavior

An error is thrown and no interaction is possible.

Reproduction information

Vagrant version

Vagrant 2.4.1

Host operating system

Operating System: Arch Linux
Kernel: Linux 6.7.9-arch1-1

Steps to reproduce

  1. Install Vagrant on the local machine (via pacman or any other available packet manager)
  2. Try to run vagrant in the terminal

Apologies for the beginner enquiry. I tried to look into this myself, but was not able to find any information. On a side note, Ruby is version 3.3.0, installed via rbenv.

UPDATE

I set up the GEM_HOME and GEM_PATH as below, so that the system knows where to look GEM_HOME /home/thilo/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0 GEM_PATH /home/thilo/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0:/opt/vagrant/embedded/gems

When I run gem pristine --all with these directories set up, a vagrant binary is placed in the GEM_HOME folder (vagrant-1.5.0) and overrides the correct one. I will then get a different error message. My understanding is that this happens because it is the most recent one available on rubygems.

For now, I have settled with installing from source via this article: https://developer.hashicorp.com/vagrant/docs/installation/source

jumski commented 1 month ago

I also have this problem!

Manjaro Linux 24

❯ uname -a
Linux laptop 6.9.0-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon May 13 07:01:28 UTC 2024 x86_64 GNU/Linux