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?
Ruby installs the dependency rbtree and builds its extension, installs the drip gem, then builds documentation for the installed gems.
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.
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):
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With