perl - 构造函数错误 : couldn't execute "git": no such file or directory

标签 perl git tcl irc bots

好的,所以我正在设置一个修改过的 eggdrop 机器人,但是在获得所有必需的 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

最佳答案

问题来自source smeggdrop/smeggdrop.tcl:smeggdrop.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 必须位于 PATH 中才能被此 perl 脚本找到。

修改 path in the right rc file (取决于您的默认 shell),adding the git bin directory,你不会再有这个问题了。

关于perl - 构造函数错误 : couldn't execute "git": no such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4778615/

相关文章:

perl - 使用最新版本的 Perl 为旧版本编写脚本

checkbox - 取消选择 ttk::checkbutton

scripting - 黑莓开发脚本语言?

python - python 正则表达式替换中的 if 语句

linux - centos 5.5 上的 Apache2::Request (libapreq2-2.13)

regex - 使用正则表达式搜索 Perl 数组并仅返回单个捕获组

git - TortoiseGit 从远程源 merge

ruby-on-rails - git push heroku 挂起

git - 从 Gitlab 有效负载获取分支名称 - Jenkins

tcl - 在 Windows 平台上创建 Tcl Starkit 的步骤