11. $ irb
• require ‘rubygems’ (only in 1.8)
• require ‘<gem name>’
• then test and enjoy it …
Question:
What does “require ‘rubygems’” do?
What does “require ‘<gem name>’” do?
RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them. It is analogous to EasyInstall for the Python programming language. RubyGems is now part of the standard library from Ruby version 1.9.Being very powerful, RubyGemsare of great importance in the Rubyland. They can easily be used to extend or change functionality within Ruby applications.More info: http://docs.rubygems.org/read/book/7
Gems are very useful for not reinventing the wheel and avoiding duplication. That’s basically it. Many Ruby developers create and publish awesome gems which address specific requirements, solve specific problems or add specific functionality. Anyone who comes across similar requirements or problems can use them and eventually improve them. That’s the joint awesomeness of Ruby’s strong open-source foundation and extreme flexibility. Anyway, you’re reading this article… so you’ve probably understood the concept and grasped its usefulness long before reading this paragraph.
require_paths: add paths to $LOAD_PATH($:)http://guides.rubygems.org/specification-reference/
Answer: show $LOAD_PATH, find rubygems.rb and then read custom_require.rb
How does it work?
How & Why?
How & Why?
How does “bundle install” work ?How does rails use it?