Skip to content

Instantly share code, notes, and snippets.

@akosednar
Last active August 29, 2015 14:03
Show Gist options
  • Save akosednar/8329e81e35cf33014883 to your computer and use it in GitHub Desktop.
Save akosednar/8329e81e35cf33014883 to your computer and use it in GitHub Desktop.
Codewall provisioning script didnt run

The issue is having to do with bundler not being installed/available to the provisioning script. As a result of this, everything is messed up when the vm is setup.

If the vagrant provisioning script does not run try the following:

  1. Start with a fresh vagrant box (so vagrant destroy your current if one is already up) and then start it with vagrant up
  2. Login to the box with vagrant sshand run rvm install 2.1.0
  3. After, run the following commands found below (which is basically the provisioning script). I ran them line by line but it might work if you just run it as a bash file.
export DEBIAN_FRONTEND=noninteractive
cd /home/vagrant
sudo su postgres -c 'pg_ctl stop -D /var/pgsql/data  2>&1'
sudo su postgres -c 'pg_ctl start -D /var/pgsql/data  2>&1 &'
echo insecure > $HOME/.curlrc
echo rvm_install_on_use_flag=1 >> $HOME/.rvmrc
echo rvm_project_rvmrc=1 >> $HOME/.rvmrc
echo rvm_trust_rvmrcs_fag=1 >> $HOME/.rvmrc
curl -k -L https://get.rvm.io | bash -s stable --autolibs=enabled
source "$HOME/.rvm/scripts/rvm"
[[ -s "$rvm_path/hooks/after_cd_bundle" ]] && chmod +x $rvm_path/hooks/after_cd_bundle
rvm requirements
rvm reload
_RUBY_VERSION=ruby-2.1.0
rvm install $_RUBY_VERSION
rvm gemset create coderwall
rvm use $_RUBY_VERSION --default
rvm use $_RUBY_VERSION@coderwall
cd $HOME/web
gem update --system && gem update bundler
bundle config --global jobs 3
bundle install
cp .env.example .env -n
sudo su postgres -c 'pg_ctl stop -D /var/pgsql/data  2>&1'
sudo su postgres -c 'pg_ctl start -D /var/pgsql/data  2>&1 &'
export DEV_POSTGRES_PORT=5432
export REDIS_URL=redis://127.0.0.1:6379
bundle exec rake db:drop:all
bundle exec rake db:create:all
bundle exec rake db:setup

After this you can switch into the web directory cd ~/web/ and run rvm current and bundle check to verify that you have all the gems and the current rvm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment