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:
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 |
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 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. answered 10 Jul '12, 21:37 seanf 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
|