Skip to main content

Freezing Gems

What is a gem and why would you want to freeze it?

In Ruby, there are times when you want to access pieces of functionality that other people of written (3rd party libraries) and you normally have 2 options. You can install a plug in or install a gem. Normally the method you use is determined by which ever is made available by the author.

Gems are installed on the host machine and are pretty handy when you want to run things in the command line or else across lots of projects, but their downside is that if you use a gem in a Rails project there is no automatic publishing mechanism when you deploy your site. You will need to log onto the remote host machine and install the gem manually.

Plugins are specific to Rails and are similar to gems in that they are also 3rd party libraries. However they are associated with your Rails project as opposed to your machine so they will get posted to the server on a regular deploy.

Freezing a gem is the process of transforming a gem into a plug in. Essentially the gem is "unwrapped" and installed into your Rails plug ins directory.
  1. Make sure the gem you want to freeze is installed.
  2. Navigate to your Rails project's home directory and type the following
  3. script/plugin install http://svn.ardes.com/rails_plugins/gems
    (this is the plugin which will freeze the gem)
  4. rake gems:freeze GEM=gem_name
Note that not every gem can be frozen successfully. Some gems rely on executables which are platform specific and these cannot be accessed from the plugins directory.

Comments

Anonymous said…
http://markonzo.edu global and other list ashley furniture [url=http://jguru.com/guru/viewbio.jsp?EID=1536072]ashley furniture[/url], calqsrh, allegiant air [url=http://jguru.com/guru/viewbio.jsp?EID=1536075]allegiant air[/url], odkrhto, pressure washers [url=http://jguru.com/guru/viewbio.jsp?EID=1536078]pressure washers[/url], 00579, dishnetwork [url=http://jguru.com/guru/viewbio.jsp?EID=1536080]dishnetwork[/url], wphtyf, adt security [url=http://jguru.com/guru/viewbio.jsp?EID=1536076]adt security[/url], dqqad,
Anonymous said…
http://lumerkoz.edu Hello good day [url="http://barborazychova.com/members/Buy-Lexapro.aspx"]lexapro[/url] tels chuyen [url="http://rc8forum.com/members/Buy-Synthroid.aspx"]synthroid side effects[/url] guevara blanchard [url="http://soundcloud.com/avodart"]avodart[/url] smoking [url="http://soundcloud.com/buy-allegra"]allegra[/url] concise [url="http://www.sqlprof.com/members/Buy-Inderal.aspx"]inderal side effects[/url] biogene
Anonymous said…
werb nxuuf Free Porn crhzrp v yk z fit
Anonymous said…
I agree with the post above and I will find more information from google.
Anonymous said…
uoow sllvk free sex szdpzbv g zm s aaw
There are may person searching about that now they will find enough resources by your post,
ファロム said…
Hi there,
Really nice job,There are many people searching about that now they will find enough sources by your tips.
Also looking forward for more tips about that
Wow, Great post,Nice work, I would like to read your blog every day Thanks
Això és realment interessant, ets un blogger molt hàbil. M'he unit a la seva alimentació i esperem que busquen més del seu missatge meravellós. A més, he compartit el seu lloc en els meus xarxes socials !
Gems are as similar as the plugins.I used one some days ago and they are really handy.
Austin Mortgage said…
I just wanted to thank you again, amazing site, where you have developed. It is for those who are actually interested in this particular topic, especially this post useful skills. Do you really all so sweet and considerate with others, plus read your blog post is a fantastic joy
jugan said…
This is so cool. I am such a huge fan of their work. I really am impressed with how much you have worked to make this website so enjoyable.
wound care
Never heared about this technique freezing gems. Looks amazing. Let me try it also.
I feel delighted to read such a good post. The author has done a great job in sharing this great piece of news with us through this blog. Thanks. Keep up the good work.
Dissertation said…
Thanks for this I have been searching for freezing gems information dissertation help
Dissertation said…
That is great! love to read about gems. Great shared. Thanks alot essay help.
I really like your writing. Thanks so much, finally a decent website with good information in it.
I'm impressed. You're truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. I'm saving this for future use.
foley catheter said…
I really don't have words to describe how much I liked this article of yours. The author really know his job well. Thanks for this wonderful share.
Unknown said…
Your blog article is very interesting and fanatic, at the same time the blog theme is unique and perfect, great job. To your success, one of the more impressive blogs I've seen. Thanks so much for keeping the internet classy for a change.

Atlanta Alarm Monitoring
aquacel said…
Fantastic post indeed. Thanks to the author for this great share. Looking forward for more quality stuff. Thanks again.
hanumant said…
I actually enjoyed reading through this posting.Many thanks.

Dissertations Help
no matter what the pros and cons of installing gems. I love to install gems on my machines

Popular posts from this blog

Master of my domain

Hi All, I just got myself a new domain ( http://www.skuunk.com ). The reason is that Blogspot.com is offering cheap domain via GoDaddy.com and I thought after having this nickname for nigh on 10 years it was time to buy the domain before someone else did (also I read somewhere that using blogspot.com in your domain is the equivalent of an aol.com or hotmail.com email address...shudder...). Of course I forgot that I would have to re-register my blog everywhere (which is taking ages) not to mention set up all my stats stuff again. *sigh*. It's a blogger's life... In any case, don't forget to bookmark the new address and to vote me up on Technorati !

Elixir - destructuring, function overloading and pattern matching

Why am I covering 3 Elixir topics at once? Well, perhaps it is to show you how the three are used together. Individually, any of these 3 are interesting, but combined, they provide you with a means of essentially getting rid of conditionals and spaghetti logic. Consider the following function. def greet_beatle(person) do case person.first_name do "John" -> "Hello John." "Paul" -> "Good day Paul." "George" -> "Georgie boy, how you doing?" "Ringo" -> "What a drummer!" _-> "You are not a Beatle, #{person.first_name}" end end Yeah, it basically works, but there is a big old case statement in there. If you wanted to do something more as well depending on the person, you could easily end up with some spaghetti logic. Let's see how we can simplify this a little. def greet_beatle(%{first_name: first_name}) do case first_name d

Speeding up RSpec

So today I have been looking into getting our enormous battery of tests to run faster. I have yet to find anything that works for Cucumber, but I did find an interesting way to speed up RSpec which is detailed here. https://makandracards.com/makandra/950-speed-up-rspec-by-deferring-garbage-collection Basically, it seems that by not collecting garbage too frequently, you can make your tests run much faster (at the expense of memory management of course). We observed a 30% reduction in the time it takes to run an RSpec test suite. I did try to implement this on Cucumber, however because we need to store much more in memory to set up and tear down our objects, it meant that I kept running out of memory when I wasn't using the default Garbage Collection and the tests took even longer (so, buyer beware). I suppose if you had a small set of features though you might see some benefit.