ruby gems vs rails gems

Sorry if this is a newbie question but what exactly is the difference between the gem structure of a Ruby gem vs. Rails gem.

Strictly speaking, all Rails gems are also Ruby gems, but not the other way around. So what additional files are required to make a ruby gem into a Rails gem.

For example, in this post, Building a ruby gem for Rails applications, the top answer suggests that all Rails gems need an init.rb. But then I found some rails gems that don't have the init.rb file. Here is an example:

Basically, I want to write a Rails gem. I find a lot of tutorials on writing Ruby gems, but I just want to make sure it works for a Rails app.


To put it simply, rails IS a ruby gem. A ruby gem is a ruby gem, and some are just built specifically for use with rails.

It's worth noting that gems and plugins are different, and you might be confusing the two:

Difference between plugins and Ruby gems?

Need Your Help

How can I know which version of WPF I am running?

wpf versioning

I have discovered some differences between WPF 3.0 and WPF 3.5.

What can cause reset connection when running PHP script?

php codeigniter connection-reset

I've developed a web application with CodeIgniter that works perfectly on my local machines (one with windows and one with Linux). When I moved it to my hosting server, connection gets reset when r...