Thursday, March 15, 2012

`require': no such file to load

Error message:
[root@localhost restful]# ruby validedge.rb
validedge.rb:3:in `require': no such file to load -- rest_client (LoadError)
from validedge.rb:3

[root@localhost restful]# cat validedge.rb
#!/usr/bin/env ruby
require 'rest_client'

#require 'rest-client'

RestClient.get 'http://google.com/'

Solution:
Add require 'rubygems'
[root@localhost restful]# cat validedge.rb
#!/usr/bin/env ruby
require 'rubygems'

require 'rest_client'

#require 'rest-client'

RestClient.get 'http://google.com/'

No comments:

Post a Comment