Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/env: ruby_executable_hooks : No such file or directory

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

like image 885
user160917 Avatar asked Nov 21 '25 16:11

user160917


2 Answers

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...

like image 176
user160917 Avatar answered Nov 24 '25 04:11

user160917


Have you tried switching to system ruby?

rvm use system

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

like image 24
Tony B Avatar answered Nov 24 '25 05:11

Tony B