Since I know almost nothing about Ruby, I'll ask the fedi hivemind for tips...

If I want to start up a Ruby REPL and import 'net/http' so that I can try one request using the latest version of the Gem, what steps should I follow? In Python I'd create a virtualenv and then use 'pip install' to install the package I want - so I assume something similar exists for Ruby. Bonus points if I can do the same thing but intentionally use an older (specific) version of the Gem.

#Ruby #RubyNewbie

@kevin For managing Ruby versions, either rbenv or the newer rv are fine choices.

With the desired Ruby version installed and active (verify with `ruby -v`), start an interactive Ruby shell with the `irb` command.

Once in an IRB session, `require “net/http”` and the Net::HTTP module should be available.

Do note that Net::HTTP is a bit of a pain to work with. There are a bunch of alternatives, though. I tend to reach for the http gem, but Faraday is also quite popular.

@jgarber In this case I need to use net-http because I'm building a reproducer for a bug in Mastodon->Paperclip->Seahorse->net-http. Thanks for the info!