开发者

I can't seem to get rails installed on my Mac (10.6.5). Following Ruby on Rails Tutorial 3

开发者 https://www.devze.com 2023-03-09 20:53 出处:网络
I\'m trying to get Rails 3 up and running by following the steps outlined in \"Ruby on Rails Tutorial\" by Michael Hartl (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book).

I'm trying to get Rails 3 up and running by following the steps outlined in "Ruby on Rails Tutorial" by Michael Hartl (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book).

The details start in section 1.2.2 (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:rubygems). Here you go through the following steps:

  1. Installing Git
  2. Installing Ruby (version 1.9.2) using Ruby Version Manager (RVM)
  3. Creating different gemsets for environments using Ruby 1.8.7 and 1.9.2
  4. Installing RubyGems

and finally, installing Rails.

I run the following command [sudo] gem install rails --version 3.0.7

Everything seemed to install co开发者_Go百科rrectly (based on no errors). However, when I type "rails -v", rails cannot be found.

I am a Rails newbie. I'm trying to install Rails on a machine running Mac OS X 10.6.7.

Thanks.


If you are using RVM you probably don't want to use sudo when installing gems. If you have Git installed only steps needed to get Rails are:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.zshrc
# Reload your shell now (open a new terminal for example)
rvm install 1.9.2
rvm 1.9.2 --default
gem install rails --version 3.0.7
hash -r

This skips the gemsets part (you don't need it if you are just starting learning Rails) and assumes that you use Zsh (I think it's Mac OS X default, if you use Bash then you have to alter .bashrc, not .zshrc).

If you want to remove your previous installation and start over use rvm implode.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号