/ usr / bin / env:ruby_executable_hooks:没有这样的文件或目录

时间:2013-10-29 14:32:53

标签: nginx capistrano raspberry-pi thin

我正在尝试使用Capistrano 3.0 / Thin / NGINX部署到Raspberry Pi我已经让它工作了,但在我的重启块中我有

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

我很满意

 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]

我已经尝试了答案here,但没有成功。

如果我通过SSH连接到PI并以root身份运行它们,命令似乎工作正常。

我应该提一下,我几乎使用了本教程:http://creativepsyco.github.io/blog/2013/04/10/deploying-rails-on-nginx-and-thin/来设置内容

3 个答案:

答案 0 :(得分:6)

完全黑客解决方案

宝石rvm1-capistrano3并没有最终为我工作,所以我最终只是硬链接ruby_executable_hooksruby这样

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

警告,这假设ruby是与RVM一起安装的,您可能希望通过执行ls -l /usr/bin | grep ruby

之类的操作来确保不会覆盖某些内容

ALSO 我意识到这完全是hackish,在生产服务器上可能不是正确的事情,但它在我的Raspberry-Pi上对我有用...

答案 1 :(得分:3)

您是否尝试过切换到系统ruby?

rvm use system

然后在那里安装capistrano。这会使您的rvm问题无法解决。

答案 2 :(得分:2)

您链接的文章是指旧版Capistrano。

看起来你正在使用rvm(ruby_executable_hooks似乎是一个RVM的东西),在这种情况下你需要一个Cap 3兼容的RVM适配器,在名为{{1}的Github上找到它们(在Capistrano帐户下)或capistrano/rvm,似乎由与rvm核心团队一致的人维护。

相关问题