snipt

Ctrl+h for KB shortcuts

Bash

mysql2 gem with mariadb

$ sudo apt-get install libmariadbd-dev
$ gem install mysql2
https://snipt.net/embed/7714f80e2d8ee14c7c0fd0df6ff3e5a4/
https://snipt.net/raw/7714f80e2d8ee14c7c0fd0df6ff3e5a4/
7714f80e2d8ee14c7c0fd0df6ff3e5a4
bash
Bash
3
2016-09-29T21:25:34
True
False
False
/api/public/snipt/140788/
mysql2-gem-with-mariadb
<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="nv">$ </span>sudo apt-get install libmariadbd-dev </span><span id="L-2"><a name="L-2"></a><span class="nv">$ </span>gem install mysql2 </span></pre></div> </td></tr></table>
gem, mariadb, mysql, ruby

Bash

asset pipeline name resolution

http://localhost:3000/assets/foundation.css => app/assets/foundation/index.css
http://localhost:3000/assets/foundation.js => app/assets/foundation/index.js
https://snipt.net/embed/09e1eb273ba9aa23dd44e7e2c7f4f8f4/
https://snipt.net/raw/09e1eb273ba9aa23dd44e7e2c7f4f8f4/
09e1eb273ba9aa23dd44e7e2c7f4f8f4
bash
Bash
2
2016-09-21T18:44:34
True
False
False
/api/public/snipt/31187/
asset-pipeline-name-resolution
<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>http://localhost:3000/assets/foundation.css <span class="o">=</span>&gt; app/assets/foundation/index.css </span><span id="L-2"><a name="L-2"></a>http://localhost:3000/assets/foundation.js <span class="o">=</span>&gt; app/assets/foundation/index.js </span></pre></div> </td></tr></table>
asset, foundation, gem

Bash

asset gem background image

zurb_foundation/app/assets/images/foundation/bg.png
https://snipt.net/embed/093d05b261c33f0357e0adc984778c4a/
https://snipt.net/raw/093d05b261c33f0357e0adc984778c4a/
093d05b261c33f0357e0adc984778c4a
bash
Bash
1
2016-09-21T18:44:45
True
False
False
/api/public/snipt/31186/
asset-gem-background-image
<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 id="L-1"><a name="L-1"></a>zurb_foundation/app/assets/images/foundation/bg.png </span></pre></div> </td></tr></table>
asset, foundation, gem

Bash

asset gem directory structure

zurb_foundation/app/assets/stylesheets/foundation/index.css
zurb_foundation/app/assets/javascripts/foundation/index.js
https://snipt.net/embed/f672350952554047c3a98b5029d19e87/
https://snipt.net/raw/f672350952554047c3a98b5029d19e87/
f672350952554047c3a98b5029d19e87
bash
Bash
2
2016-09-21T18:44:51
True
False
False
/api/public/snipt/31185/
asset-gem-directory-structure
<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>zurb_foundation/app/assets/stylesheets/foundation/index.css </span><span id="L-2"><a name="L-2"></a>zurb_foundation/app/assets/javascripts/foundation/index.js </span></pre></div> </td></tr></table>
asset, foundation, gem

Bash

directory structure

1
2
3
zurb_foundation/app/assets/stylesheets/foundation
zurb_foundation/app/assets/javascripts/foundation
zurb_foundation/app/assets/images/foundation
https://snipt.net/embed/44320db1e19a54f868f2cc09e409b079/
https://snipt.net/raw/44320db1e19a54f868f2cc09e409b079/
44320db1e19a54f868f2cc09e409b079
bash
Bash
3
2016-09-26T00:37:21
True
False
False
/api/public/snipt/31184/
directory-structure
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>zurb_foundation/app/assets/stylesheets/foundation </span><span id="L-2"><a name="L-2"></a>zurb_foundation/app/assets/javascripts/foundation </span><span id="L-3"><a name="L-3"></a>zurb_foundation/app/assets/images/foundation </span></pre></div> </td></tr></table>
directory, foundation, gem, structure

Bash

creating a new gem using bundler

bundle gem zurb_foundation
https://snipt.net/embed/1032e833a91f9ff855e0157556a187d7/
https://snipt.net/raw/1032e833a91f9ff855e0157556a187d7/
1032e833a91f9ff855e0157556a187d7
bash
Bash
1
2016-09-21T18:44:59
True
False
False
/api/public/snipt/31153/
creating-a-new-gem-using-bundler
<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 id="L-1"><a name="L-1"></a>bundle gem zurb_foundation </span></pre></div> </td></tr></table>
bundler, gem

Ruby

Uninstall version of gem

1
2
3
4
5
#list all versions of a particular gem
gem list GEMNAME

#uninstall a particular version
gem uninstall GEMNAME --version=VERSION
https://snipt.net/embed/5d39879f98886c682f8808b9b044455d/
https://snipt.net/raw/5d39879f98886c682f8808b9b044455d/
5d39879f98886c682f8808b9b044455d
rb
Ruby
5
2016-09-21T18:45:17
True
False
False
/api/public/snipt/25247/
uninstall-version-of-gem
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c1">#list all versions of a particular gem</span> </span><span id="L-2"><a name="L-2"></a><span class="n">gem</span> <span class="n">list</span> <span class="no">GEMNAME</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1">#uninstall a particular version</span> </span><span id="L-5"><a name="L-5"></a><span class="n">gem</span> <span class="n">uninstall</span> <span class="no">GEMNAME</span> <span class="o">--</span><span class="n">version</span><span class="o">=</span><span class="no">VERSION</span> </span></pre></div> </td></tr></table>
gem, install, ruby, uninstall

Bash

unpack specific gem to rails app

rake gems:unpack GEM=specific_gem
https://snipt.net/embed/722fcdd3bc9ded0ad914ef7ab04a7bb7/
https://snipt.net/raw/722fcdd3bc9ded0ad914ef7ab04a7bb7/
722fcdd3bc9ded0ad914ef7ab04a7bb7
bash
Bash
1
2016-09-21T18:45:24
True
False
False
/api/public/snipt/19529/
unpack-specific-gem-to-rails-app
<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 id="L-1"><a name="L-1"></a>rake gems:unpack <span class="nv">GEM</span><span class="o">=</span>specific_gem </span></pre></div> </td></tr></table>
gem
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.