Skip to content

Getting Wordmove installed in VVV (or any Vagrant)

Conrad Ramos edited this page May 20, 2022 · 14 revisions

WARNING ⚠️

As reported in https://github.com/welaika/wordmove/issues/598, the following documentation is outdated.

Anyone is welcome to update it and remove this warning accordingly.

NOTE

You can find wordmove utility provisioner at https://github.com/welaika/vvv-wordmove


Varying Vagrant Vagrants

VVV is an open source Vagrant configuration focused on WordPress development. You can easily configure VVV to be provisioned with wordmove on vagrant provision.

To do so:

  • Find the provision folder in your VVV root folder.
  • Add the following to your vvv-init.sh file, or if you do no have one yet, create a file called vvv-init.sh and fill it with:
# Rubygems update

if [ $(gem -v|grep '^2.') ]; then
	echo "gem installed"
else
	apt-get install -y ruby-dev
	echo "ruby-dev installed"
	echo "gem not installed"
	gem install rubygems-update
	update_rubygems
fi

# wordmove install
wordmove_install="$(gem list wordmove -i)"
if [ "$wordmove_install" = true ]; then
  echo "wordmove installed"
else
  echo "wordmove not installed"
  gem install wordmove

  wordmove_path="$(gem which wordmove | sed -s 's/.rb/\/deployer\/base.rb/')"
  if [  "$(grep yaml $wordmove_path)" ]; then


    echo "can require yaml"
  else
    echo "can't require yaml"
    echo "set require yaml"

    sed -i "7i require\ \'yaml\'" $wordmove_path

    echo "can require yaml"

  fi
fi
  • Provision your vagrant with $ vagrant provision, $ vagrant up --provision, or $ vagrant reload --provision
  • Once Vagrant is up, run $ vagrant ssh. Now, navigate to your site folder $ cd /srv/www/myproject and run your Wordmove magic. Pay special attention: all of the paths in your Movefile must be the absolute path in Vagrant, because that's where you're running Wordmove from. so ~/Your_OSX_Username/Desktop/VVV isn't going to work. In the future you won't have to worry if you simply run $ wordmove init from Vagrant. I actually got rid of Wordmove on my native OS for this exact reason.

tl;dr

To get wordmove running in vagrant:

$ apt-get install -y ruby-dev
$ gem install rubygems-update
$ update_rubygems
$ gem install wordmove

tl;dr alternative

There are two different versions of ruby installed in VVV: for normal users and for sudo. The ruby version for sudo is 1.9 while the ruby version for normal users is 2.4.

"sudo gem install wordmove" will give an error because Ruby version >= 2.2.2 is required.

"gem install wordmove" will give an error because normal users don't have permission to install a gem.

The solution is to make the ruby directory publicly writeable with

sudo chmod -R 777 /usr/local/rvm/gems/ruby-2.4.1
gem install wordmove

On Ubuntu 14.04.5 LTS - Latest VVV 23.01.2018

sudo chmod -R 777 /usr/share/rvm/gems/ruby-2.4.0