新的 Ruby 用户,我完全上瘾了,喜欢它......但是......我已经遇到了一个障碍 已经阅读了大量关于 Ruby 基础/理论/等的内容,通过“Bastards”Ruby 课程和我尝试使用“rest-client”gem 时收到错误消息
我输入:
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 上
感谢你的帮助