Created
November 22, 2010 18:35
-
-
Save MSch/710395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
gems = Gem.source_index.search(Gem::Dependency.new(//, Gem::Requirement.default)) | |
gems.each do |gem| | |
puts "gem '#{gem.name}', '#{gem.version.to_s}'" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem list | |
*** LOCAL GEMS *** | |
bundler (1.0.7) | |
rack (1.0.1) | |
rake (0.8.7) | |
sqlite3-ruby (1.3.2) | |
xml-simple (1.0.12) | |
$ gems2gemfile | |
gem 'bundler', '1.0.7' | |
gem 'rack', '1.0.1' | |
gem 'rake', '0.8.7' | |
gem 'sqlite3-ruby', '1.3.2' | |
gem 'xml-simple', '1.0.12' | |
>> Copy and paste into Gemfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a simple problem. I just set up a legacy Rails 2.3 app and spent the whole afternoon hunting down dependencies. Since I used rvm, my gemset contained exactly the dependencies I needed. Now I wanted to turn that gemset into a Gemfile.