无法加载此类文件--Infifile(LoadError)Ruby

时间:2017-06-11 09:11:12

标签: ruby

我在执行ruby脚本时面临以下问题。有什么想法吗?

<script>
        $( document ).ready(function() {
        //Just some array to have the values available. You don't necessarily have to do this. This will just make the values available even after the loop ends.
        var arr = new Array(3);
        var i= 0;
            //Add your table id here.
            $('#yourtableid tr:last').each(function() {
            $(this).find('td').each (function() {   
              //Iterating over each td in tr and then assigning value to each of the array element    
              arr[i] = $(this).html();
              i++;
            });  
        });
            //Values as retrieved from the td
            for(i = 0;i<3;i++){
                console.log("Values in td: " +arr[i]);
            }
        }); 
        </script>

Windows 7 64位

Ruby版本 - ruby​​ 2.4.1p111(2017-03-22修订版58053)[x64-mingw32]

Bundler版本1.15.1

gem - v:2.6.11

我尝试了D:\my_ruby>ruby format.rb C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' : cannot load such file -- inifile (LoadError) from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55 :in `require' from format.rb:2:in `<main>' ,但问题仍然存在。

代码:

bundle update

1 个答案:

答案 0 :(得分:1)

当我从Ruby 2.0升级到Ruby 2.4时,同样的问题发生在我身上。只需安装inifile gem:gem install inifile即可。问题应该消失。