Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of all gems

What ever happend to Rails.configuration.gems in Rails 3? I guess it has to do with Bundler. But how can I find all gems now?

Thanks

like image 606
rejeep Avatar asked Oct 17 '25 05:10

rejeep


1 Answers

Yes it has to do with Bundler. In Rails 3 your application's gem manifest is in a file called Gemfile. Some good explanations on the changes and how to use them here, here, here and here.

UPDATE:

The bundle show CLI lists the gems in use by your application. But, programmatically you can get to the same thing as follows:

require 'bundler'
mygems = Bundler.load.specs.map { |spec| spec.name }

The spec object also contains other attributes of interest.

like image 186
bjg Avatar answered Oct 20 '25 05:10

bjg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!