I'm attempting to set up a hosting server for my rails app. They have a tutorial and very specific way of setting up the environment. I've followed it to the best of my ability and either I've made a mistake or they have. I've substituted the appropriate username for USERNAME
I've set up my .bash_profile like they state:
# START
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$HOME/.gems/bin:$HOME/bin:$PATH
GEM_HOME=$HOME/.gems
GEM_PATH=$HOME/.gems:/usr/lib/ruby/gems/1.8
export PATH GEM_HOME GEM_PATH
# END
Then I'm instructed to run: source ~/.bash_profile
Then gem install rails
Then they say to add this line to .bash_profile before the export statement, which I don't understand because it's already in there leading me to believe it's a typo:
PATH=$HOME/.gems/bin/:$HOME/bin:$PATH
Then again run source ~/.bash_profile
Then when I run which rails I should get: /home/USERNAME/.gems/bin/rails
but I get /usr/bin/rails
Can anyone help me point to the right direction? Thanks.
Also here's the output of gem env
:
RubyGems Environment:
- RUBYGEMS VERSION: 1.6.2
- RUBY VERSION: 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/USERNAME/.gems
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /home/USERNAME/.gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/USERNAME/.gems
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => false
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "-no-ri --no-rdoc"
- :sources => ["http://gems.rubyforge.org/", "http://rubygems.org"]
- "gempath" => ["/home/USERNAME/.gems", "/usr/lib/ruby/gems/1.8"]
- "gemhome" => "/home/USERNAME/.gems"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://rubygems.org