snipt

Ctrl+h for KB shortcuts

Bash

Run a Ruby script which references custom libraries and gems

$ ruby -I<lib_dir> -rubygems <script_name>
https://snipt.net/embed/e3f0568e0c42796d3b903e5587510fdb/
/raw/e3f0568e0c42796d3b903e5587510fdb/
e3f0568e0c42796d3b903e5587510fdb
bash
Bash
1
2019-06-09T12:48:42
True
False
False
/api/public/snipt/36664/
run-a-ruby-script-which-references-custom-libraries-and-gems
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ ruby -I&lt;lib_dir&gt; -rubygems &lt;script_name&gt; </span></pre></div> </td></tr></table>
ruby

Bash

Upgrade Ruby from RVM

$ rvm upgrade <from> <to>
https://snipt.net/embed/d2368ea777915ba9f1b7f6447935fa81/
/raw/d2368ea777915ba9f1b7f6447935fa81/
d2368ea777915ba9f1b7f6447935fa81
bash
Bash
1
2019-07-09T17:13:40
True
False
False
/api/public/snipt/28600/
upgrade-ruby-from-rvm
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ rvm upgrade &lt;from&gt; &lt;to&gt; </span></pre></div> </td></tr></table>
ruby, rvm

Bash

Upgrade/downgrade RubyGems

$ gem update --system <version>
https://snipt.net/embed/518a64f93af2eb3101582417105795bc/
/raw/518a64f93af2eb3101582417105795bc/
518a64f93af2eb3101582417105795bc
bash
Bash
1
2019-07-15T01:44:10
True
False
False
/api/public/snipt/26894/
upgradedowngrade-rubygems
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ gem update --system &lt;version&gt; </span></pre></div> </td></tr></table>
ruby, rubygems

Bash

Uninstall all Ruby gems

# http://geekystuff.net/2009/1/14/remove-all-ruby-gems
$ gem list | cut -d" " -f1 | xargs sudo gem uninstall -aIx
https://snipt.net/embed/2a26e81ee1f89e4fd8ff493b9a5a85ff/
/raw/2a26e81ee1f89e4fd8ff493b9a5a85ff/
2a26e81ee1f89e4fd8ff493b9a5a85ff
bash
Bash
2
2019-07-15T15:56:44
True
False
False
/api/public/snipt/25310/
uninstall-all-ruby-gems-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># http://geekystuff.net/2009/1/14/remove-all-ruby-gems</span> </span><span id="L-2"><a name="L-2"></a>$ gem list <span class="p">|</span> cut -d<span class="s2">&quot; &quot;</span> -f1 <span class="p">|</span> xargs sudo gem uninstall -aIx </span></pre></div> </td></tr></table>
ruby, rubygems