2

I'm trying to deploy to a Raspberry Pi using Capistrano 3.0 / Thin / NGINX I've got it working, but in my restart block I have

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute '/etc/init.d/thin restart'
      execute 'sudo /etc/init.d/nginx restart'
    end
  end
end

To which I am greated with

 INFO [128fb9a3] Running /etc/init.d/thin restart on raspberrypi.local
DEBUG [128fb9a3] Command: /etc/init.d/thin restart
DEBUG [128fb9a3]    /usr/bin/env: 
DEBUG [128fb9a3]    ruby_executable_hooks
DEBUG [128fb9a3]    : No such file or directory
DEBUG [128fb9a3]

I've tried the answer here but with no success.

The commands seem to work fine if I SSH into the PI and run them as root.

I should mention that I pretty much used this tutorial: http://creativepsyco.github.io/blog/2013/04/10/deploying-rails-on-nginx-and-thin/ to get things setup

Community
  • 1
  • 1
user160917
  • 9,211
  • 4
  • 53
  • 63

3 Answers3

6

Totally Hackish Solution

The gem rvm1-capistrano3 didn't end up working for me, so i ended up just hard linking ruby_executable_hooks and ruby like so

$ ln -s `which ruby_executable_hooks` /usr/bin/ruby_executable_hooks
$ ln -s `which ruby` /usr/bin/ruby

WARNING, This assumes that ruby was installed with RVM, you might want to make sure you are not going to overwrite something by doing something like ls -l /usr/bin | grep ruby

ALSO I realize this is totally hackish and probably not the right thing to do on a production server, but it worked for me on my Raspberry-Pi...

user160917
  • 9,211
  • 4
  • 53
  • 63
3

Have you tried switching to system ruby?

rvm use system

Then install capistrano there. This would take your rvm issues out of play.

Tony B
  • 323
  • 2
  • 7
2

The article you linked refers to the old version of Capistrano.

It looks like you are using rvm (the ruby_executable_hooks seems to be an RVM thing), in which case you'll need one of the Cap 3 compatible RVM adapters, find them at Github named capistrano/rvm (under the Capistrano account) or rvm1-capistrano3, which appears to be maintained by someone aligned with the rvm core team.

Lee Hambley
  • 6,270
  • 5
  • 49
  • 81