bundle: command not found

b1bb2

New Member
My system is debian 11 on local PC. I am following neocities install instructions at https://github.com/neocities/neocities.

These commands work:
debian@debian:~$ vagrant up --provision
debian@debian:~$ vagrant ssh

Problem is here:
vagrant@vagrant:~$ bundle exec rackup -o 0.0.0.0
-bash: bundle: command not found
vagrant@vagrant:~$

I researched but could not find anything named bundle. I did find bundler. I ran: sudo apt install -y bundler. That command only installs documentation, in /usr/share/doc/bundler. Following that documentation, I ran: sudo gem install bundler.

Now bundle works with user debian. Here is a problem after that:
debian@debian:~$ bundle
Could not locate Gemfile
debian@debian:~$

After getting the bundle command working for user debian, I repeated the above steps to install neocities, I get the same error:
vagrant@vagrant:~$ bundle exec rackup -o 0.0.0.0
-bash: bundle: command not found
vagrant@vagrant:~$

Here is full terminal output:
Code:
debian@debian:~$ vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/bionic64' version '1.0.282' is up to date...
debian@debian:~$ vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Sep  1 18:07:40 UTC 2022

  System load:  0.0               Processes:           88
  Usage of /:   2.5% of 61.80GB   Users logged in:     0
  Memory usage: 11%               IP address for eth0: 10.0.2.15
  Swap usage:   0%


0 packages can be updated.
0 updates are security updates.


Last login: Thu Sep  1 17:29:22 2022 from 10.0.2.2
vagrant@vagrant:~$ bundle exec rackup -o 0.0.0.0
-bash: bundle: command not found
vagrant@vagrant:~$

After that problem is fixed, the neocities install instructions says: Now you can access the running site from your browser: http://127.0.0.1:9292
 

Cromewell

Administrator
Staff member
bundle is part of https://bundler.io/ which you found and installed.

It sounds like you are just missing the binary from your path when you are the vagrant user. As debian, what bundle is in use? `which bundle`

Once you know where it is, check your paths to make sure it is there. It could also be file permissions so I would check that as well, you probably want 755.

Then where you execute the command matters, since I am pretty sure it looks for a Gemfile (part of ruby's packaging system)
 

b1bb2

New Member
Thank you Cromewell. Good idea. But it did not fix the problem. Your solution applies to system space, but I end up in virtual space. I checked my paths in system using ls, they are good. Paths for vagrant (virtual) user are bad. GUI says /usr/local/bin/bundle permissions are root, rw, r, r, x. Where should I execute the command?

This is strange. Side note. Here is part of terminal when I ran instructions a second time. It has extra text. Maybe some trash was detected and cleaned?
Code:
debian@debian:~$ vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/bionic64' version '1.0.282' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (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 reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> 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: 6.0.10
    default: VirtualBox Version: 6.1
==> default: Mounting shared folders...
    default: /vagrant => /home/debian

Here is full unedited terminal when I ran instructions a third time.
Code:
debian@debian:~$ which bundle
/usr/local/bin/bundle
debian@debian:~$ which vagrant
/usr/bin/vagrant
debian@debian:~$ /usr/bin/vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/bionic64' version '1.0.282' is up to date...
debian@debian:~$ /usr/bin/vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Sep  2 01:40:43 UTC 2022

  System load:  0.01              Processes:           88
  Usage of /:   2.5% of 61.80GB   Users logged in:     0
  Memory usage: 11%               IP address for eth0: 10.0.2.15
  Swap usage:   0%

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

0 packages can be updated.
0 updates are security updates.


Last login: Fri Sep  2 01:22:39 2022 from 10.0.2.2
vagrant@vagrant:~$ which bundle
vagrant@vagrant:~$ which vagrant
vagrant@vagrant:~$ ls
vagrant@vagrant:~$ /usr/local/bin/bundle
-bash: /usr/local/bin/bundle: No such file or directory
vagrant@vagrant:~$ ls /usr/bin/vagrant
ls: cannot access '/usr/bin/vagrant': No such file or directory
vagrant@vagrant:~$

Firefox can’t establish a connection to the server at 127.0.0.1:9292. Problems start after user changes to vagrant@vagrant. GUI shows the only user is /home/debian.
 

Cromewell

Administrator
Staff member
My bad, I didn't read/understand what your prompts were telling me. It looks like you need bundler installed in the virtual machine that is being spun as opposed to the host.

That being said, I checked the vagrant files, and it looks like it should be installed already https://github.com/neocities/neocities/blob/master/vagrant/ruby.sh
You could always try reinstalling manually while connected to the VM, it is possible that the install failed. I don't see anything in the console output that you posted that looks related to any install failing though
 

b1bb2

New Member
OK, I installed bundler in the virtual machine. Making progress. I am not familiar with vagrant and bundle and Gemfile. It seems I go into a virtual machine and I am suprised that sudo is automatically set up. I am suprised that VM keeps its settings, so it is not RAM. Why is some of this code not in neocities install instructions? What is gemname? How to install rackup? What is rackup version? Here is some of my recient terminal output.
Code:
debian@debian:~$ vagrant up --provision
debian@debian:~$ vagrant ssh
vagrant@vagrant:~$ sudo apt-get update
vagrant@vagrant:~$ sudo apt install -y bundler
vagrant@vagrant:~$ bundle init
vagrant@vagrant:~$ bundle install
Use `bundle info [gemname]` to see where a bundled gem is installed.
vagrant@vagrant:~$ bundle exec rackup -o 0.0.0.0
bundler: command not found: rackup
Install missing gem executables with `bundle install`
vagrant@vagrant:~$ which bundle
/usr/bin/bundle

These hints might work but I am asking before I experiment more.
Code:
bundle exec rackup
/usr/bin/rackup
rackup[version]

And here are some various commands I tried.
Code:
vagrant@vagrant:~$ bundle install
The Gemfile specifies no dependencies
Resolving dependencies...
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

ls /home/vagrant/Gemfile
vagrant@vagrant:~$ ls /home/vagrant/Gemfile
/home/vagrant/Gemfile

vagrant@vagrant:~$ bundle info GEM
Could not find gem 'GEM'.

vagrant@vagrant:~$ bundle info Gemfile
Could not find gem 'Gemfile'.

I do not understand what you said about the vagrant files. You say vagrant file should already be installed in my VM? How to check?
 

beers

Moderator
Staff member
I am suprised that sudo is automatically set up. I am suprised that VM keeps its settings, so it is not RAM.
Why is this surprising? Your container has a different configuration, and sudo can be configured however you want it.

Treat your container like it's an entirely separate PC.
 

Cromewell

Administrator
Staff member
I do not understand what you said about the vagrant files. You say vagrant file should already be installed in my VM? How to check?
Vagrant is a tool to build a virtual machine.

The neocities vagrant file is https://github.com/neocities/neocities/blob/master/Vagrantfile, it references the shell scripts in https://github.com/neocities/neocities/tree/master/vagrant

These instructions should build a virtual machine with all the prerequisites installed already.

This command is connecting to the machine it created. This is why the host name in your prompt changes, and part of what I missed initially in your post about bundler setup.
Code:
vagrant ssh

What are the contents of this file? Just cat it out, I am assuming it should have the same contents as this https://github.com/neocities/neocities/blob/master/Gemfile
Code:
ls /home/vagrant/Gemfile
vagrant@vagrant:~$ ls /home/vagrant/Gemfile
/home/vagrant/Gemfile
 

Cromewell

Administrator
Staff member
I mean it could help organize simliarish questions, but we really don't see enough traffic in particular for code stuff that it is truly necessary.
 
Top