Created
September 18, 2012 10:06
-
-
Save kgrz/3742383 to your computer and use it in GitHub Desktop.
Shell script experiments for exporting and installing gems for different versions of Ruby
This file contains hidden or 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
| TL;DR | |
| Putting it all together: Make sure you are using the Ruby version that you need to export from | |
| $ gem list > ~/gemlist && rbenv local rbx-1.2.4 && \ | |
| gem install `awk -F' ' '{print $1}' ~/gemlist` && rm ~/gemlist | |
| How I got there: | |
| By exporting to a file: | |
| $ gem list > ~/gemlist | |
| $ awk -F' ' '{ print $1}' ~/gemlist | |
| In a single command: (pipes FTW!) | |
| $ gem list | awk -F' ' '{ print $1 }' | |
| Installing in the 2nd version of Ruby: | |
| $ gem install `awk -F' ' '{print $1}' ~/gemlist` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment