What should I do? Here is the error
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rails:18
You're running Mac OS. Apple ships Ruby with Mac OS, though it's there for Apple's own use. We can piggyback on it, but modifying it can cause problems, so we recommend using RVM or rbenv to install one or more Ruby versions in a sandbox, which allows us to update, add, delete gems at will without affecting Apple's Ruby.
I use them both, with rbenv being on my personal machine and work laptop.
You can also use Homebrew to install Ruby. It is nice when installing a single version but doesn't provide nearly the features/controls for managing multiple versions. I don't recommend or use it for installing or managing Ruby as a result.
You can also install from the source code. I don't recommend that unless you know what you're doing so that's all I'll say about it.
The OS version you're on is old, and no longer supported by Apple. You can upgrade to a newer Ruby but you'll also need to install your Xcode installation along with its related command-line tools. While RVM might find a prebuilt Ruby to install, any gems that have native extensions will need to be compiled, requiring Xcode, and finding Xcode that supports old OSes might be difficult.
You need an updated version of ruby to install rails:
brew install ruby
gem install rails
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.