Search code examples
ruby-on-railsdeploymentcapistranowebistrano

Webistrano bash/sh problem!


I love Capistrano and finally i found GUI for using it!

Webistrano!

I installed the app that many other guys recommend it to me.

Finally, its time to try... I flow the screencast ..etc.. and found in my production.log this error: 'sh: ruby command not found'

I followed this blog post but naaaah!! same problem...

This is what i tried in script/console as the blog post said!

>> system("sh -c \"ruby -v\"") 
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01
=> true
>> system("bash --login -c \"ruby -v\"") 
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01
=> true

Solution

  • I set the full path of Ruby in app/models/deployment.rb under def deploy_in_background.

    And being like this [i'm using ree]:

    system("sh -c \"cd #{RAILS_ROOT} && /opt/ruby-enterprise/bin/ruby script/runner -e... etc.
    

    Thanks to Jonathan Weiss: http://twitter.com/jweiss/status/19105123857