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

发布于 2024-10-14 08:38:09 字数 1921 浏览 7 评论 0 原文

好的,所以我正在设置一个修改后的 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

Ok, so I am setting up a modified eggdrop bot, but after getting all the required perl modules and libraries, I am getting this error:

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.

Here is line 12 of tcltest.pl:

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

Which contains:

# 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

And smeggdrop.conf is:

# 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必了 2024-10-21 08:38:09

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

修改右侧的路径< code>rc 文件(取决于您的默认 shell),添加 git bin 目录, 这样您就不会再遇到此问题了。

The problem comes from source smeggdrop/smeggdrop.tcl: smeggdrop.tcl, in turns, sources smeggdrop/versioned_interpreter.tcl which has a section like:

  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"
    }
  }

That means git has to be in the PATH to be found by this perl script.

Modify the path in the right rc file (depending on your default shell), adding the git bin directory, and you won't have this issue anymore.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文