Copy file from host to vagrant


You would like to quickly copy a file from the local host to the vagrant machine.


Find the private key, ssh and IP port with ssh-config:

Copy the file using the private key as a parameter to scp:

Taken from the answer here

Can’t install RMagick 2.13.1. Can’t find Magick-config


You are trying to install rmagick in an Ubuntu 12.04 virtual box, but you get the following error:


Make sure you install both the imagemagick and the libmagickwand-dev packages with either apt-get :

or in a puppet script as:

$rvm_path (/home/ubuntu/.rvm/) does not exist. error


When you want to use the capistrano recipe to deploy to a vagrant virtual box as described in ‘Deploying Rails’, and after you have corrected the rvm_path as described here, you get the following error message:


Make sure that after adding the rvm_path add also the following to the deploy.rb file, since rvm is installed system wide.

Suggestion from here.

.rvm/bin/rvm-shell: No such file or directory error


When trying to set up the capistrano deploy recipe to deploy to the vagrant virtual box as described in ‘Deploying rails’, you get the error:

when you have installed rvm system wide on the virtual box.


Make sure that you add the following into your deploy.rb file to set up the path for rvm:

Solution taken from here

Could not find puppet (>= 0) amongst [] (Gem::LoadError)


When you try to apply the puppet configuration into a vagrant box and using systemwide rvm installation (if you follow the instructions here), you have the following error:


Use rvmsudo instead of sudo to make sure that the paths are correct:

Vagrant – rvm – ruby – puppet installation instructions


In order to install a vagrant box with rvm and puppet following the examples in the ‘Deploying Rails’ book, the updated steps needed are described below.
The two main differences are a) rvm system wide installation as recommended here, and b) the puppet 3.0.1 version support of ruby 1.9.3 here


So below are the steps followed to make it work.

  1. Remove system ruby
  2. Remove script as it adds a path that no longer exists:
  3. Install rvm with system wide installation:
  4. Add vagrant user and any other additional user to the rvm group:
  5. Exit and login back in to install ruby 1.9.3-p327 (current)
  6. install necessary ruby dependencies suggestest by previous command:
  7. Creat a gemset to be used with the desired rvm ruby version:
  8. Use the created gemset to install puppet gem:
  9. Install puppet as the vagrant user and NOT as sudo:
  10. install the puppet user and group as per book instructions:
  11. Optionally create a puppet directory to put manifests and modules and create a .rvmrc file to use specified gemset, by adding the following line to puppet/.rvmrc:
  12. use rvmsudo instead of sudo to apply the puppet scripts:

Creating a Vagrant Box with Debian Lenny 32, rvm and Ruby 1.9.3

As an addition to the excellent beta book ‘Deploying Rails’, as I had problems using the suggested lucid64 image, I’ve tried to install a debian lenny 32 image with rvm and Ruby 1.9.3.

The steps needed are listed below


  1. Download the lenny package:
  2. Make a new directory for the virtual box:
  3. change into created directory and create the Vagrant file:
  4. change the Vagrant file to use the virtual box we have downloaded:
  5. Start the VM:
  6. If there is a warning about the Guest additions here install the latest guest additions by following the description here, but only use the update and upgrade steps as:
  7. After finishing the upgrade logout (exit) from the VM and issue the command to restart the VM:
  8. login to the VM again:

  9. Download and install rvm by using the script described here :
  10. Add the loading of the RVM function into .bashrc, by running the following in the command prompt:
  11. Reload the bashrc file:
  12. Make sure that the rvm is loaded as function:
  13. Run the rvm requirement to see the needed libraries and then run the suggested ones (except libreadline6 and libreadline6-dev that are not there in debian):
  14. Install Ruby 1.9.3 :
  15. Use the ruby 1.9.3 as default:
  16. Finally create a new VM package to use in future:
  17. And add it our box list: