I just created a test gem using bundle and it created a .gem file with unreadable content so I was wondering
what does that .gem file contains ? is this binary data ? as I used to think that .gem files contains packaged ruby functions
how is this .gem file being used by rails framework ? since it doesn't look like a module
Thanks
The RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” which contains a packaged Ruby application or library. Gems can be used to extend or modify functionality in Ruby applications.
ThunderSoft GemPlayer is a free video player which supports password protected video file(GEM file) and many other common media files. It is powerful that can play all the most popular video/audio format. And it is the only player which can play GEM file, an encrypted video format.
Gemfile is a file which must be located in root of your rails project. It is used for describing gem dependencies for Ruby programs.
Gems in Rails are libraries that allow any Ruby on Rails developer to add functionalities without writing code. You can also call Ruby on Rails gems as plugins for adding features. A Ruby gem enables adding features without creating the code again and again.
You can see what is happening if you check the file on your file system.
In a Posix environment, you can check the file with the file command:
$: file bundler-1.3.0.gem
bundler-1.3.0.gem: POSIX tar archive
As you can see it is a tar archive. So it is a binary file, packaged and managed by the gem
tool.
It is 'binary' so you will not see it as you may have expected.
You are correct though, and you can continue to think that it contains packaged ruby 'functions'.
Everything that you have told it to contain through your gemspec (however you included it) is there.
As far as how Rails uses the gemfile, it is used generally by installing the gem to your system, how ever that is done is partially dependent on your environment decisions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With