-
-
Save actsasflinn/102286 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 /Users/r38y/Desktop/gems.txt" | |
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