snipt

Ctrl+h for KB shortcuts
Notice: Snipt is moving away from free accounts on May 1st, 2014. Read more about the transition here.
#20066

Ruby

Reinstall current gems in irb

# Reinstall current gems in irb
> `gem list`.each_line {|line| system "sudo gem install #{line.split.first}"}
https://snipt.net/embed/a7912175ac9202059f5190332ae1ae58/
https://snipt.net/raw/a7912175ac9202059f5190332ae1ae58/
a7912175ac9202059f5190332ae1ae58
rb
Ruby
2
2014-04-23T02:39:40
True
False
/api/public/snipt/20066/
reinstall-current-gems-in-irb
<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 id="L-1"><a name="L-1"></a><span class="c1"># Reinstall current gems in irb</span> </span><span id="L-2"><a name="L-2"></a><span class="o">&gt;</span> <span class="sb">`gem list`</span><span class="o">.</span><span class="n">each_line</span> <span class="p">{</span><span class="o">|</span><span class="n">line</span><span class="o">|</span> <span class="nb">system</span> <span class="s2">&quot;sudo gem install </span><span class="si">#{</span><span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="o">.</span><span class="n">first</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">}</span> </span></pre></div> </td></tr></table>
gems, ruby