运行 p1pp 时出现问题 - GLI.run 不再适用于 GLI-2

Posted

技术标签:

【中文标题】运行 p1pp 时出现问题 - GLI.run 不再适用于 GLI-2【英文标题】:Trouble running p1pp - GLI.run no longer works for GLI-2 【发布时间】:2012-11-22 14:56:40 【问题描述】:

我是 ruby​​ 新手,想试试 ProcessOne 的推送平台 (p1pp)

我已经下载了 p1pp 的源代码(来自 https://github.com/processone/p1pp),尝试在 Ubuntu 12.04 中运行它。

$./bin/p1.rb

得到错误:

/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- gli (LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from ./bin/p1.rb:16

使用命令安装 gli

gem install gli

这次我得到了

/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- blather/client/dsl (LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /home/krishna/PubSub/p1pp-master/lib/p1pp/p1_publisher.rb:2
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from ./bin/p1.rb:18

安装的废话:

gem install blather

现在我被困在这里:

You should include GLI::App instead
GLI.run no longer works for GLI-2, you must just call `run(ARGV)' instead
either fix your app, or use the latest GLI in the 1.x family

任何帮助将不胜感激。谢谢!

【问题讨论】:

【参考方案1】:

自己找到了解决方案!

包括 GLI::App 而不是 GLI 并将最后一行中的“exit GLI.run(ARGV)”更改为“exit run(ARGV)

在此处找到此信息:

[1]http://forums.pragprog.com/forums/200/topics/10975

[2]https://github.com/bencevans/hnews/issues/3

【讨论】:

以上是关于运行 p1pp 时出现问题 - GLI.run 不再适用于 GLI-2的主要内容,如果未能解决你的问题,请参考以下文章

运行 Pig 脚本时出现异常

从用户终端运行 Eclipse 时出现错误,但不是从 root 运行

从终端运行时出现运行时错误,但不是从 Eclipse

在数据块上运行 sql 查询时出现不匹配错误

从 Java 运行 AppleScript 时出现“不允许辅助访问”错误

(Laravel) 运行迁移时出现不正确的日期时间格式错误