I’m making a gem (lets call it stackoverflow), and in order for it to work, I need to require another gem (lets say I need typhoeus) in the gems code. Do I need to do anything outside of the normal
require rubygems
require gemname
$code
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Define it as a dependency in your
gemspec. Check out the Specification Reference, or more specifically, #add_runtime_dependency over at RubyGems guides (Which is awesome, by the way). This ensures that your libraries dependencies will be installed along with your own gem.Apart from that, just use
requireas you would have before. Happy hacking!