Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.1

Ruby on Rails Gem general information


I am wondering what are gems? Coming from C++, Java, its seem they are packages which form a class or a plugin i should say.

  • But how do they work? Most of them are on github to be shared but what happens when i place them in my gemfile and run bundle install?

  • Do i place the current version into a temporary file in the localhost or his the server fetching the information all the time from the github?7

  • If they are on the server can i modify the gem somehow?

Thank you


Solution

  • Gems are libraries; collections of Ruby files, descriptors, tests, and whatever else the library has.

    They're installed locally when you do a bundle install.

    Use bundle show [gem_name] to see where a gem was installed.

    I'd recommend using rvm or an equivalent to manage different sets of gems/rubies, though.