Take the 2-minute tour ×

I was after creating a destination folder to allow Vagrant go ahead with the synced_folder configuration, so I created my bash script and tested it outside the environment. This is working fine, so I decided to move it as an inline script just to make my Vagrant file easy to read.

However, I always end up getting this error

Vagrant failed to initialize at a very early stage:

There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:

/Users/andreamoro/Documents/Vagrant/MyVagrantExperiment/Vagrantfile:64: can't find string "SCRIPT" anywhere before EOF
/Users/andreamoro/Documents/Vagrant/MyVagrantExperiment/Vagrantfile:30: syntax error, unexpected end-of-input, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END

Using the example supplied for the shell provisioner at http://docs.vagrantup.com/v2/provisioning/shell.html produces the same output if the $script variable is created in between the Vagrant.configure("2") do |config| block, whereas if the script is created outside it Vagrant doesn't execute it at all.

What's the matter? Thanks Andrea

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Vagrant author helped me out on this confirming an hidden "create" option for the sync_folder method is available but was not documented.

The full thread here.


share|improve this answer
add comment

Your Answer


