(As first, this question is not "which is better" question. I just want to know how they are similar and differ in functionality perspective.)
I'm php developer and currently learning ruby.
In these days, many php developers are encouraged to use Composer
for dependency management. Before asking questions, I would like to validate my knowledge first.
According to my understanding,
Composer
is a dependency management tool for php libraries (or packages).Composer
installed php library per project basis (so-called locally). I mean php library installed for project1 cannot be reused for project2 without install again for project2.
I've noticed that Ruby also has very good dependency management tool "RubyGems
".
According to my knowledge,
- "
RubyGems
" is a package manager for "Gems". - "
Gem
" is a Ruby program or library packaged in a standard format for sharing. (Rails is also a gem.) Gem
can be installed by command like thatgem install sinatra
.- But, there is also so-called "
Bundler
" which is also a gem for bundling gems for an application. - When command
bundle install
runs (under specific ruby project directory), all the gems listed in the Gemfile are installed for this ruby project.
So, my questions are here.
Composer
is similar to whetherRubyGems
orBundler
?- When run
gem install sinatra
, is it installed on system-wide level ? - When run
bundle install
, the Gems are installed whether locally (on this project only) or system-wide level ? - If I need two versions of one
gem
(for e.g. sinatra) for different projects, how should I handle ?
(Sorry for my long question. If my understandings are something wrong, sorry again and please point out the right one.)