【问题标题】:Error while executing IronRuby with bewildr使用 bewildr 执行 IronRuby 时出错
【发布时间】:2012-08-10 07:24:38
【问题描述】:

我正在尝试使用 Bewildr、黄瓜和 IronRuby 自动化 WPF。 到目前为止,作为一个婴儿步骤,我已经完成了以下操作

在 C:\IronRuby 中安装 IronRuby1.1 安装了 Bewildr 和 cucumber gem

在 IronRuby bin 中创建了一个 Ruby 文件 sample.rb

require 'rubygems'    
require 'bewildr'    
@app, @main_window = Bewildr::Application.start_app_and_wait_for_window("C:\\Documents and Settings\\321106\\Desktop\\ExpenseItStandalone.exe", /App v1.\d+/)

当我在 cmd 提示符下使用

ruby sample.rb

我收到以下错误:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/bewildr-0.1.14/lib/bewildr.rb:7:in `<top (required)>': Bewildr only works under IronRuby (LoadError)
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from adding_steps.rb:3:in `<main>'

【问题讨论】:

    标签: ruby ironruby


    【解决方案1】:

    你正试图在普通的 ruby​​ 中运行 bewildr。您需要使用 IronRuby。而不是:

    ruby sample.rb
    

    试试:

    ir sample.rb
    

    【讨论】:

    • 我意识到 ir.exe 位于不同的路径中。现在 ir.exe 和程序驻留在同一个文件夹中,但我仍然收到类似未知的错误:没有要加载的文件 -- gem_prelude.rb (LoadError)
    • 现在出现一个新错误:>>> require 'minitest' C:/Program Files/IronRuby 1.1/Lib/ruby/1.9.1/rubygems/custom_require.rb:29:in r equire': no such file to load -- minitest (LoadError)fromC:/Program Files/IronRuby1.1/Lib/ruby/1.9.1/rubygems/custom_require.rb:29:in require ' 来自 (ir):1
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-27
    • 2017-10-14
    • 2020-06-11
    • 1970-01-01
    • 1970-01-01
    • 2012-01-28
    相关资源
    最近更新 更多