WebFaction
Community site: login faq

I have followed WebFaction's instructions for installing gems for my Rails application, but it appears that I need to repeat the installation process to install bundle for each session in which I need to run rake.

If I do not repeat the process of installing bundle for a given SSH session, when I try to run a rake task, I get an error such as:

/home/<username>/gems/gems/pg-0.12.2/lib/pg_ext.so: [BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Aborted

I am not sure why Ruby 1.8.7 is referenced above since I am using Rails 3.2.x with Ruby 1.9.3.

How can I avoid having to export PATH, GEM_HOME, and RUBYLIB and then do "gem install bundle" for every session in which I want to run rake (including in a cron job that runs rake)?

Thanks.

asked 10 Jul '12, 16:25

evan
123
accept rate: 0%

edited 10 Jul '12, 16:27


You must set PATH, GEM_HOME, and RUBYLIB to the correct app-specific values prior to running commands for your app like "gem" and "rake".

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.

If you need them set for a cron job, then just set them in your crontab or wrap your rake command in a shell script that sets the variables, and then run that script via cron instead of running rake directly.

permanent link

answered 10 Jul '12, 21:37

seanf
12.2k42136
accept rate: 37%

Thank you, seanf. Adding the settings to my .bash_profile as you suggested solved the problem. I was also able to get the cron job working according to your instructions.

(11 Jul '12, 09:26) evan
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:

×108
×11
×6
×1

question asked: 10 Jul '12, 16:25

question was seen: 3,934 times

last updated: 11 Jul '12, 09:26

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2020 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