Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install the Ruby gem 'net/http'?

Tags:

ruby

gem

I am trying to use some Ruby code found here.

In the code it has:

require 'net/http'

However, when I write in the terminal:

sudo gem install net/http

It gives the error:

ERROR: Could not find a valid gem 'net/http' (>= 0) in any repository

Could someone tell me how to install this gem please?

like image 936
user1893354 Avatar asked Nov 11 '13 15:11

user1893354


People also ask

Does Ruby install gem?

Ruby installs the dependency rbtree and builds its extension, installs the drip gem, then builds documentation for the installed gems.

How do I install a new gem?

To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs. There are other sources of libraries though.

What is gem install?

gem install , in its simplest form, does something kind of like this. It grabs the gem and puts its files into a special directory on your system. You can see where gem install will install your gems if you run gem environment (look for the INSTALLATION DIRECTORY: line):


1 Answers

You do not need to install anything to use net/http. It is part of your regular ruby distribution.

Just run the script and it should work out of the box.

like image 116
kostja Avatar answered Oct 23 '22 18:10

kostja