Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
这个时候我输入:sudo gem install rails,如下
SmallHe:~ SmallHe$ sudo gem install rails Password: Successfully installed rails-3.2.1 1 gem installed Installing ri documentation for rails-3.2.1... Installing RDoc documentation for rails-3.2.1...
这里显示已经安装成功
SmallHe:~ SmallHe$ rails -v 这里我输入 rails 查看版本信息,还是出现如下信息:
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
如此反复。。不明白是肿么了?
SmallHe:Storage SmallHe$ gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /opt/local/lib/ruby/gems/1.8 directory.
成功了。谢谢各位。把这两个一装,不知道是哪个起了作用。
再用 gem install rails 变化 就不一样了
gem install rails Fetching: i18n-0.6.0.gem (100%) Fetching: multi_json-1.1.0.gem (100%) Fetching: activesupport-3.2.1.gem (100%) Fetching: builder-3.0.0.gem (100%) Fetching: activemodel-3.2.1.gem (100%) Fetching: rack-1.4.1.gem (100%) Fetching: rack-cache-1.1.gem (100%) Fetching: rack-test-0.6.1.gem (100%) Fetching: journey-1.0.3.gem (100%) Fetching: hike-1.2.1.gem (100%) Fetching: tilt-1.3.3.gem (100%) Fetching: sprockets-2.1.2.gem (100%) Fetching: erubis-2.7.0.gem (100%) Fetching: actionpack-3.2.1.gem (100%) Fetching: arel-3.0.2.gem (100%) Fetching: tzinfo-0.3.31.gem (100%) Fetching: activerecord-3.2.1.gem (100%) Fetching: activeresource-3.2.1.gem (100%) Fetching: mime-types-1.17.2.gem (100%) Fetching: polyglot-0.3.3.gem (100%) Fetching: treetop-1.4.10.gem (100%) Fetching: mail-2.4.1.gem (100%) Fetching: actionmailer-3.2.1.gem (100%) Fetching: rake-0.9.2.2.gem (100%) Fetching: thor-0.14.6.gem (100%) Fetching: rack-ssl-1.3.2.gem (100%) Fetching: json-1.6.5.gem (100%) Building native extensions. This could take a while... Fetching: rdoc-3.12.gem (100%) Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install
= 1.9.2 : nothing to do! Yay! Fetching: railties-3.2.1.gem (100%) Fetching: bundler-1.0.22.gem (100%) Fetching: rails-3.2.1.gem (100%) Successfully installed i18n-0.6.0 Successfully installed multi_json-1.1.0 Successfully installed activesupport-3.2.1 Successfully installed builder-3.0.0 Successfully installed activemodel-3.2.1 Successfully installed rack-1.4.1 Successfully installed rack-cache-1.1 Successfully installed rack-test-0.6.1 Successfully installed journey-1.0.3 Successfully installed hike-1.2.1 Successfully installed tilt-1.3.3 Successfully installed sprockets-2.1.2 Successfully installed erubis-2.7.0 Successfully installed actionpack-3.2.1 Successfully installed arel-3.0.2 Successfully installed tzinfo-0.3.31 Successfully installed activerecord-3.2.1 Successfully installed activeresource-3.2.1 Successfully installed mime-types-1.17.2 Successfully installed polyglot-0.3.3 Successfully installed treetop-1.4.10 Successfully installed mail-2.4.1 Successfully installed actionmailer-3.2.1 Successfully installed rake-0.9.2.2 Successfully installed thor-0.14.6 Successfully installed rack-ssl-1.3.2 Successfully installed json-1.6.5 Successfully installed rdoc-3.12 Successfully installed railties-3.2.1 Successfully installed bundler-1.0.22 Successfully installed rails-3.2.1 31 gems installed Installing ri documentation for i18n-0.6.0... Installing ri documentation for multi_json-1.1.0... Installing ri documentation for activesupport-3.2.1... Installing ri documentation for builder-3.0.0... Installing ri documentation for activemodel-3.2.1... Installing ri documentation for rack-1.4.1... Installing ri documentation for rack-cache-1.1... Installing ri documentation for rack-test-0.6.1... Installing ri documentation for journey-1.0.3... Installing ri documentation for hike-1.2.1... Installing ri documentation for tilt-1.3.3... Installing ri documentation for sprockets-2.1.2... Installing ri documentation for erubis-2.7.0... Installing ri documentation for actionpack-3.2.1... Installing ri documentation for arel-3.0.2... Installing ri documentation for tzinfo-0.3.31... Installing ri documentation for activerecord-3.2.1... Installing ri documentation for activeresource-3.2.1... Installing ri documentation for mime-types-1.17.2... Installing ri documentation for polyglot-0.3.3... Installing ri documentation for treetop-1.4.10... Installing ri documentation for mail-2.4.1... Installing ri documentation for actionmailer-3.2.1... Installing ri documentation for rake-0.9.2.2... Installing ri documentation for thor-0.14.6... Installing ri documentation for rack-ssl-1.3.2... Installing ri documentation for json-1.6.5... Installing ri documentation for rdoc-3.12... Installing ri documentation for railties-3.2.1... Installing ri documentation for bundler-1.0.22...
建议 ruby,gem,rails 等使用 rvm 来管理、 本质上,你用 rvm 管理了 ruby,那么 gem,rails 都自动和 rvm 的 ruby 关联了。 会和系统的独立开来的。