开发者

How does Ruby (on Windows) find your Requires (libraries)

What technique does a ruby script use to find your libraries / requires on Windows.

I have an install of Ruby 1.8.7 on Windows to the path C:\Ruby187 and non of my "requires" work.

For example, just a test file

require "rack"

gives no such file to load -- rack (LoadEr开发者_C百科ror)

gem list rack is there


Try

require 'rubygems'
require 'rack'

I believe that in Ruby 1.9+, you no longer have to require 'rubygems', but it is necessary on <= 1.8.

Otherwise, $: is the "Load path for scripts and binary modules by load or require".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜