Skip to content

Installation on VirtualBox Guests

Derek Bender edited this page May 28, 2018 · 8 revisions

NOTE: As of v0.9.2, this is not necessary anymore.

If you're working in a directory that's mounted from the host machine you can't do certain file operations. In particular, if the directory Spring uses for its tmp files are in a shared directory then you will get the following type of error:

/home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:85:in `unlink': Text file busy - /media/sf_Sites/rails_projects/golf_mentor/tmp/spring/spring.pid (Errno::ETXTBSY)
    from /home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:85:in `unlink'
    from /home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:85:in `block (2 levels) in set_exit_hook'
    from /home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:84:in `each'
    from /home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:84:in `block in set_exit_hook'
/home/chris/.rvm/gems/ruby-1.9.3-p392/gems/spring-0.0.8/lib/spring/server.rb:34:in `initialize': Operation not permitted - "/media/sf_Sites/rails_projects/golf_mentor/tmp/spring/spring" (Errno::EPERM)

In order to fix this, you need to create a temporary directory on the virtual machine which is not a shared folder and is on the virtual machine. For example if your ~ directory is /home/vagrant, then type the following:

mkdir ~/spring_tmp; export SPRING_TMP_PATH=/home/vagrant/spring_tmp

Then type a spring command such as spring rspec followed by spring status to check the server is running.

If Spring is running then add the following line to ~/.bashrc

export SPRING_TMP_PATH=/home/vagrant/spring_tmp # Temp PATH for spring

Credit for this goes to George Brocklehurst and Justin Leveck.