WebFaction
Community site: login faq

I'm a total newbie to Rails. I'm evaluating Rails for a new project.

I'm trying to follow the instructions at http://docs.webfaction.com/software/rails.html. I have installed my first Rails "application" with the Control Panel - apparently successfully, as I can bring up the "Welcome Aboard" screen in

I get confused in the sections titled "Upgrading RubyGems" and "Installing Gems". My confusions are:

  1. Were some Gems installed for me when I installed my first app? If so, what are they and where are they?
  2. If I have to install Gems myself, there seems to be a choice available between installing a set for each Rails app (as described under "Installing Gems" in this article) vs installing a set that would be globally available to all Ruby apps, including Rails (as described at http://docs.webfaction.com/software/ruby.html#ruby-installing-gems). Is this right?
  3. If point 2 is right, what are the considerations in choosing between installing Gems locally for each app vs installing a single global set?

~ Thanks in advance

~ Ken

asked 19 May '15, 23:23

kenatsun's gravatar image

kenatsun
1917
accept rate: 25%


Were some Gems installed for me when I installed my first app? If so, what are they and where are they?

Yes, gems were installed for your Rails app, namely Rails itself and its dependencies. They are located in the gems/gems subdirectory of your Rails application.

If I have to install Gems myself, there seems to be a choice available between installing a set for each Rails app (as described under "Installing Gems" in this article) vs installing a set that would be globally available to all Ruby apps, including Rails (as described at http://docs.webfaction.com/software/ruby.html#ruby-installing-gems). Is this right?

Yes.

If point 2 is right, what are the considerations in choosing between installing Gems locally for each app vs installing a single global set?

Your app is configured, out-of-the-box, to use its own local gems. It won't use gems installed elsewhere unless you reconfigure it to do so. We recommend that you use local gems for each application.

permanent link

answered 19 May '15, 23:40

seanf's gravatar image

seanf ♦♦
12.0k21534
accept rate: 37%

edited 19 May '15, 23:40

Thanks, Sean. That clears up a lot.

May I tack on one more question?: Why do you recommend local rather than global gems?

~ Ken

(20 May '15, 02:01) kenatsun kenatsun's gravatar image

Initially there's no difference at all, but the differences begin to emerge when you have multiple Rails applications.

For instance, maybe in the future you install a newer version of Rails, which uses newer versions of some gems, and those newer versions aren't compatible with a previous application. You can introduce some very difficult-to-find bugs in this way, breaking an old site, when it appears that nothing had changed.

By using gems local to each application, you minimize the possibility that an older application being run purely in maintenance mode is adversely affected by the requirements of an otherwise completely unrelated application.

Put differently, this allows you to start new projects in the future which use the latest versions of software, not being locked into old versions of gems because of the requirements of another app under your account.

(20 May '15, 05:01) ryans ♦♦ ryans's gravatar image

Got it. Makes sense. Thanks again!

(20 May '15, 18:39) kenatsun kenatsun's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×105
×11

question asked: 19 May '15, 23:23

question was seen: 914 times

last updated: 20 May '15, 18:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM