欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

/usr/bin/env: ruby -ws: No such file or directory

程序员文章站 2022-03-08 20:37:40
...

 

要写个用ruby写的程序的启动脚本,脚本是这样的:

 

 

其实是shell代码。。。

#!/bin/sh
#
# Startup script for css
#
# chkconfig: - 85 15
# description: cssd server
# processname: css
#


# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
  start)
        echo -n "Starting css: "
        if [ -f /var/lock/subsys/css ] ; then
                echo
                exit 1
        fi
        `ruby root/release/1.0.9_B201104011000/CSSD/1.1/bin/server start` 
        echo
        touch /var/lock/subsys/css
        ;;
  stop)
        echo -n "Shutting down css: "
        `ruby /root/release/1.0.9_B201104011000/CSSD/1.1/bin/server stop` 2> /dev/null     #作个弊
        echo
        rm -f /var/lock/subsys/css
        ;;
  status)
        status css
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac

exit 0
   
这是pptp的启动脚本,剽窃了一下。剽窃的很烂。yuan同学,是吧

 

 

 

执行的时候出现如下错误
/usr/bin/env: ruby -ws: No such file or directory

 


在要执行的程序前加上了ruby ruby_command

 

这下报错是“/etc/init.d/css: line 27: ruby: command not found”

 

添加了一个连接:ln -s /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby /sbin/ruby


执行继续报错:Shutting down css: /etc/init.d/css: line 27: CSS-Deliver:: command not found

yuan同学你猜这样下去的结果是什么?