构造函数出错:无法执行“git”:没有这样的文件或目录

时间:2011-01-24 04:22:05

标签: perl git tcl irc bots

好的,所以我正在设置一个修改过的eggdrop bot,但是在获得所有必需的perl模块和库之后,我收到了这个错误:

sudo perl run-test
Running bot 18076
tcltest

Error in constructor: couldn't execute "git": no such file or directory at tcltest.pl line 12.

这是tcltest.pl的第12行:

print $tcl->EvalFile("smeggdrop.tcl"),$/;

其中包含:

# smeggdrop.tcl
encoding system utf-8
set SMEGGDROP_ROOT [file dirname [info script]]

if [file exists smeggdrop.conf] {source smeggdrop.conf}
source $SMEGGDROP_ROOT/smeggdrop/smeggdrop.tcl

而smeggdrop.conf是:

# smeggdrop.conf
#
# HTTP limits
#
set smeggdrop_http_requests_per_eval  5                     ;# Maximum number of requests per eval per channel
set smeggdrop_http_request_interval   60                    ;# Interval for the smeggdrop_http_request_limit setting, in seconds
set smeggdrop_http_request_limit      25                    ;# Maximum number of requests per interval per channel
set smeggdrop_http_post_limit         150000                ;# Maximum POST body size
set smeggdrop_http_transfer_limit     150000                ;# Maximum GET response size
set smeggdrop_http_time_limit         5000                  ;# Maximum execution time, in milliseconds
set smeggdrop_log_max_lines           20                    ;# Maximum lines to record per channel

#
# Publish settings - comment these out if you don't want [publish]
#
# set smeggdrop_publish_url             http://www.example.org/           ;# URL to publish to
# set smeggdrop_publish_hostname        example.org                       ;# SSH hostname
# set smeggdrop_publish_username        myusername                        ;# SSH username
# set smeggdrop_publish_password        mypassword                        ;# SSH password
# set smeggdrop_publish_filename        /home/example/htdocs/index.txt    ;# Filename to write to

1 个答案:

答案 0 :(得分:1)

问题来自source smeggdrop/smeggdrop.tclsmeggdrop.tcl,来源smeggdrop/versioned_interpreter.tcl,其中包含以下部分:

  method initialize_repository {} {
    mkdir_p [$self path]
    mkdir_p [$self path procs]
    mkdir_p [$self path vars]
    touch [$self path procs _index]
    touch [$self path vars _index]

    if ![$self repository_exists] {
      $self git init
      $self git add procs vars
      $self commit "Created repository"
    }
  }

这意味着git必须在这个perl脚本中找到PATH

修改 path in the right rc file (取决于您的默认shell),adding the git bin directory,,您将不再遇到此问题。