Search code examples
ruby-on-railsrubydeploymentvlad-deployer

Ruby on rails deployment with Vlad on windows


I am having a problem with Vlad on windows. After calling rake vlad:deploy I am getting the following: uninitialized constant Fcntl::F_SETFD

After googling for a while I figured out that there is problem with open4 gem that is not suitable for Windows and I should use popen4 gem instead. I installed it but nothing has changed.

How can I force vlad to use popen4 instead of open4?


Solution

  • Vlad and Capistrano are not intended for Microsoft Windows systems. Even if you manage to get it running under Windows you will find new limitations. These tools are just nice wrappers (rake tasks) for automating SCM/SSH/SFTP tasks. I know Capistrano uses xcopy.exe to remotely deploy files but it is't as powerful as rsync or scp.

    If you are still interested, open4 dependencies are hardcoded on the source, the only way to get it running is by hacking the code.

    http://hitsquad.rubyforge.org/svn/vlad/2.0.0/lib/rake_remote_task.rb

    ...
    require 'open4'
    ...
    ##
    # Rake::RemoteTask is a subclass of Rake::Task that adds
    # remote_actions that execute in parallel on multiple hosts via ssh.
    
    class Rake::RemoteTask < Rake::Task
    
      @@current_roles = []
    
      include Open4
    ...
    

    By the way, using Capistrano will simplify you life but as advertised do not expect to take full Capistrano potential as it has minor support.