Created
April 27, 2009 02:03
-
-
Save r38y/102283 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 | |
# use this to install the same gems you have installed under one ruby in another | |
# run "gem list > ~/Desktop/gems.txt" | |
# run "ruby install_gems.rb ~/Desktop/gems.txt" | |
# You may have to change which ruby you use to run this so the gems get installed | |
# in the right place, for instance, using the REE ruby specifically while your server | |
# is running on another version... basically, think about what you're doing. | |
gems = IO.readlines(ARGV.first) | |
gems.map! do |g| | |
stuff = g.split(' ') | |
gem_name = stuff.delete_at(0) | |
stuff.map{|v| v.gsub(/[\(\)\,]/, '')}.map{|v| "sudo gem install #{gem_name} -v=#{v}"} | |
end.flatten! | |
gems.each do |g| | |
puts "running '#{g}'" | |
`#{g}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment