gpt4 book ai didi

ruby - Ocra 在打包脚本时抛出错误

转载 作者:数据小太阳 更新时间:2023-10-29 07:17:40 25 4
gpt4 key购买 nike

SCENARIO

我已经安装了 Ruby 2.1.5 (x64)包然后我安装了Ocra gem 成功:

gem install ocra
Fetching: ocra-1.3.3.gem (100%)
Successfully installed ocra-1.3.3
Parsing documentation for ocra-1.3.3
Installing ri documentation for ocra-1.3.3
Done installing documentation for ocra after 0 seconds
1 gem installed

PROBLEM

我正在尝试打包测试脚本:

# -*- coding: UTF-8 -*-

# require ''
exit if Object.const_defined?(:Ocra)

print "Hello World!"
sleep 3

__END__

但是当我尝试使用 Ocra 时,它会抛出错误:

ocra "TestScript.rb"

=== Loading script to check dependencies
=== Detected gem ocra-1.3.3 (loaded, files)
=== 6 files, 190931 bytes
=== Detected gem io-console-0.4.2 (loaded, files)
C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:86:in `open':
No such file or directory @ dir_initialize - C:/Program Files/Ruby/lib/ruby/gem
s/2.1.0/gems/io-console-0.4.2 (Errno::ENOENT)
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
86:in `entries'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
86:in `entries'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
92:in `find_all_files'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
665:in `block (2 levels) in find_gem_files'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
658:in `each'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
658:in `block in find_gem_files'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
611:in `each'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
611:in `find_gem_files'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
728:in `build_exe'
from C:/Program Files/Ruby/lib/ruby/gems/2.1.0/gems/ocra-1.3.3/bin/ocra:
1165:in `block in <top (required)>'

QUESTION

为什么会这样?如何解决?

最佳答案

问题源于安装irb1.8而不是 irb 依赖包。如果您已经安装了 irbl.8,只需执行“apt-get install irb”即可解决该问题。

关于ruby - Ocra 在打包脚本时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27666901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com