我正在尝试为我的Rails应用设置托管服务器。 他们有一个教程以及非常具体的环境设置方法。 我已尽我所能地遵循了它,或者我犯了一个错误或他们犯了一个错误。 我已经用适当的用户名代替了USERNAME

我已经按照他们的状态设置了.bash_profile:

# 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

然后,我被指示运行: source ~/.bash_profile

然后gem install rails

然后他们说要在export语句之前将此行添加到.bash_profile,我不明白,因为它已经在那儿了,这使我相信这是一个错字:

PATH=$HOME/.gems/bin/:$HOME/bin:$PATH

然后再次运行source ~/.bash_profile

然后,当我运行哪个rails时,我应该得到: /home/USERNAME/.gems/bin/rails但我得到了/usr/bin/rails

谁能帮助我指出正确的方向? 谢谢。

这也是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

  ask by Joe Essey translate from so

本文未有回复,本站智能推荐: