Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrantfile requires reinstalling foreman and gem bundles #19180

Closed
trwnh opened this issue Sep 16, 2022 · 9 comments
Closed

Vagrantfile requires reinstalling foreman and gem bundles #19180

trwnh opened this issue Sep 16, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@trwnh
Copy link
Member

trwnh commented Sep 16, 2022

Steps to reproduce the problem

  1. vagrant box update to ensure you are using the latest ubuntu/bionic64 image
  2. vagrant destroy to reset your state to default
  3. vagrant up to bring up the vm
  4. Run vagrant ssh -c "cd /vagrant && foreman start" as instructed

Expected behaviour

Mastodon dev instance starts successfully

Actual behaviour

errors

Specifications

The first error is that foreman is not found:

bash: foreman: command not found

I run vagrant ssh -c "cd /vagrant && gem install foreman" to fix this.

The second error is that bundle gems aren't installed:

Warning: the running version of Bundler (2.2.33) is older than the version that created the lockfile (2.3.22). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.3.22`.
03:19:06 web.1     | started with pid 5965
03:19:06 sidekiq.1 | started with pid 5966
03:19:06 stream.1  | started with pid 5967
03:19:06 webpack.1 | started with pid 5968
03:19:06 sidekiq.1 | bundler: command not found: sidekiq
03:19:06 sidekiq.1 | Install missing gem executables with `bundle install`
03:19:06 web.1     | bundler: command not found: puma
03:19:06 web.1     | Install missing gem executables with `bundle install`
03:19:06 stream.1  | yarn run v1.22.19
03:19:06 stream.1  | $ node ./streaming/index.js
03:19:06 webpack.1 | /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/git.rb:214:in `rescue in load_spec_files': https://github.com/ClearlyClaire/webpush.git (at f14a4d5@f14a4d5) is not yet checked out. Run `bundle install` first. (Bundler::GitError)
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/git.rb:210:in `load_spec_files'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/path.rb:107:in `local_specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/git.rb:178:in `specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/lazy_specification.rb:88:in `__materialize__'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:75:in `block in materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:72:in `map!'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:72:in `materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:467:in `materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:185:in `specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:233:in `specs_for'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/runtime.rb:18:in `setup'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler.rb:150:in `setup'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/setup.rb:20:in `block in <top (required)>'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/ui/shell.rb:136:in `with_level'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/ui/shell.rb:88:in `silence'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/setup.rb:20:in `<top (required)>'
03:19:06 webpack.1 | 	from <internal:/home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
03:19:06 webpack.1 | 	from <internal:/home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
03:19:06 webpack.1 | 	from ./bin/webpack-dev-server:11:in `<main>'
03:19:06 webpack.1 | /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/path.rb:209:in `load_spec_files': The path `/home/vagrant/.rvm/gems/ruby-3.0.4@mastodon/bundler/gems/webpush-f14a4d52e201` does not exist. (Bundler::PathError)
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/git.rb:211:in `load_spec_files'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/path.rb:107:in `local_specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/source/git.rb:178:in `specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/lazy_specification.rb:88:in `__materialize__'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:75:in `block in materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:72:in `map!'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/spec_set.rb:72:in `materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:467:in `materialize'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:185:in `specs'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/definition.rb:233:in `specs_for'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/runtime.rb:18:in `setup'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler.rb:150:in `setup'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/setup.rb:20:in `block in <top (required)>'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/ui/shell.rb:136:in `with_level'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/ui/shell.rb:88:in `silence'
03:19:06 webpack.1 | 	from /home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/bundler/setup.rb:20:in `<top (required)>'
03:19:06 webpack.1 | 	from <internal:/home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
03:19:06 webpack.1 | 	from <internal:/home/vagrant/.rvm/rubies/ruby-3.0.4/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
03:19:06 webpack.1 | 	from ./bin/webpack-dev-server:11:in `<main>'
03:19:07 web.1     | exited with code 127
03:19:07 system    | sending SIGTERM to all processes
03:19:07 sidekiq.1 | exited with code 127
03:19:07 stream.1  | WARN Starting streaming API server master with 1 workers
03:19:07 stream.1  | exited with code 1
03:19:07 webpack.1 | exited with code 1

I run vagrant ssh -c "cd /vagrant && bundle install" to fix this.

At this point, vagrant ssh -c "cd /vagrant && foreman start" works and the mastodon.local dev instance successfully starts.

@trwnh trwnh added the bug Something isn't working label Sep 16, 2022
@trwnh trwnh changed the title Vagrantfile requires Vagrantfile requires reinstalling foreman and gem bundles Sep 16, 2022
@techhead
Copy link
Contributor

techhead commented Dec 5, 2022

Pull request #22075 fixes this.

@techhead
Copy link
Contributor

techhead commented Dec 5, 2022

The glitch by which you are forced to install gems bundler and foreman twice was apparently related to the way in which rvm was being installed.

To alter, I followed the installation guide. https://rvm.io/rvm/install
Which pointed to the RVM package for Ubuntu. https://github.com/rvm/ubuntu_rvm

I followed the instructions given there in order to update the Vagrantfile for PR #22075.

@eslerm
Copy link

eslerm commented Dec 5, 2022

Nice find. Thanks for the upgrade.

Could you replace cd /vagrant && foreman start with foreman start -d /vagrant in your PR?

@techhead
Copy link
Contributor

techhead commented Dec 5, 2022

Nice find. Thanks for the upgrade.

Could you replace cd /vagrant && foreman start with foreman start -d /vagrant in your PR?

Was going to, but I tried it first. And that doesn't work with the new rvm setup. Got the above (and below) error again.

bash: foreman: command not found

There is some sort of trigger to where foreman is not in the path until you cd /vagrant

The following suggested command works now though:

cd /vagrant && foreman start

@eslerm
Copy link

eslerm commented Dec 5, 2022

ah, gotchya

curious how $PATH is now defined

I liked that bundler/yarn packages were installed to $HOME and not installed to /vagrant. It may be an issue if #22075 installs those packages to /vagrant, as that folder might be bidirectionally synced (i.e., they should not be persistent).

@techhead
Copy link
Contributor

techhead commented Dec 6, 2022

ah, gotchya

curious how $PATH is now defined

I liked that bundler/yarn packages were installed to $HOME and not installed to /vagrant. It may be an issue if #22075 installs those packages to /vagrant, as that folder might be bidirectionally synced (i.e., they should not be persistent).

They are still installed to $HOME and not to /vagrant.
See https://github.com/rvm/ubuntu_rvm.

This package installs rvm with some defaults:

  • stable rvm is used;
  • rvm is installed using mixed-mode install: usable by all users on the system, with isolated rubies/gemsets in user's $HOME > (see more here);
  • rvm is installed into /usr/share/rvm (as Debian/Ubuntu convention);
  • automatic updates provided by a Ubuntu PPA;

And feel free to boot up the Vagrantfile and explore for yourself.

@techhead
Copy link
Contributor

techhead commented Dec 7, 2022

PR #22075 was merged. So this issue should be resolved.

@nickjuntilla
Copy link

"foreman: command not found" still

@nickjuntilla
Copy link

Ok works after doing the bundle install and then vagrant ssh -c "foreman start -d /vagrant"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants