新的Ruby用戶和我完全上癮了,喜歡它......但是......我碰到了一個障礙吧 已經閱讀了大量的Ruby基礎知識/理論/等 我的工作方式,通過「私生子」紅寶石教訓,我收到錯誤消息試圖使用時「休息客戶」寶石rubygems rest-client錯誤信息
我進入:
require "rubygems"
require "rest-client"
res = RestClient.get("http://en.wikipedia.org/wiki")
puts res.code
#=> 200
puts res.body
#=> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
#=> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
#=> <html lang="en" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml">
#=> <head> ...
並獲得:
LoadError: no such file to load — rest-client
method gem_original_require in custom_require.rb at line 36
method require in custom_require.rb at line 36
at top level in gem.rb at line 2
copy output
Program exited with code #1 after 0.06 seconds.
我敢肯定,這是很基本的,感覺有些尷尬尋求幫助,但我已經嘗試每一個地方可以找到一個解決
在Mac OS10
感謝您的幫助
嗯,你確定這不是'rest_client'以下劃線?嘗試將'require rest-client'改爲'require rest_client' – potench
嘗試過,不幸的是它沒有工作 – user1902953
執行'gem install rest-client'然後再試一次 – potench