WebFaction
Community site: login faq

My account's a mix of PHP and Ruby applications. What do I need to type into my .bash_profile to handle:

  • one gemset per app
  • Ruby 2.0 for everything that isn't PHP
  • Bundler never again telling me "Your Ruby version is 1.8.7, but your Gemfile specified 2.0.0"

I read WF's gem docs and have no idea what to actually type where. How do I pull this off?

asked 21 Jan '14, 22:28

jskolnick
112
accept rate: 0%


Each application has its own ruby binary and gems path for a reason. It is best practice to keep them separate. When you need to install gems for a given application you would follow steps 1-6 in this documentation. By invoking the export commands in steps 2-5 you are setting the gems and binary path for the rest of that session.

permanent link

answered 21 Jan '14, 23:13

johns
5.4k312
accept rate: 23%

I've got seanf's answer in mind: "If you don't want to set them manually each time, then set them in your .bash_profile - but be aware that you'll need to override them if you're working with multiple apps."

(21 Jan '14, 23:40) jskolnick

What that means that if you have appA and appB, and you put this in your .bash_profile...

export GEM_HOME=$HOME/webapps/appA/gems
export RUBYLIB=$HOME/webapps/appA/lib
export PATH=$HOME/webapps/appA/bin:$PATH

... then your shell environment will be configured to work with appA, and not appB, and that if you want to work with appB, you'll need to reset those variables accordingly.

(21 Jan '14, 23:45) seanf
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:

×81
×8
×7
×2
×2

question asked: 21 Jan '14, 22:28

question was seen: 1,876 times

last updated: 21 Jan '14, 23:45

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM