我是Rails的新手,也是命令行的谨慎用户。我想在Mac OS 10.8上安装最新版本的Rails。我按照http://installrails.com/的说明进行操作。我开始运行RailsInstaller-1.0.4-osx-10.7.app,它成功安装了Rails 3.2.12。
$ rails --version
Rails 3.2.12
$ gem -v
1.8.25
$ gem update --system
...
Successfully installed rubygems-update-2.4.6
然后我继续更新步骤。
我已成功运行these commands,
$ sudo rvm get stable
$ rvm install 2.0.0 \
--with-openssl-dir=$HOME/.rvm/usr \
--verify-downloads 1
...
$ rvm --version
rvm 1.26.11 (latest...)
$ /bin/bash --login
$ rvm use --default 2.0.0
Using /usr/local/rvm/gems/ruby-2.0.0-p643
$ ruby --version
ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-darwin12.6.0]
但是,当我输入...
$ rails --version
我被告知......
Rails is not currently installed on this system.
...虽然早些时候,同样的命令告诉我安装了Rails 3.2.12。我猜测Ruby 2.0.0和Rails 3.2.12不兼容。所以I continue。
现在,当我运行命令时......
$ sudo gem install rails --no-ri --no-rdoc
...我收到此错误:
Running 'install' for libxml2 2.9.2... ERROR, review '/usr/local/rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-apple-darwin12.6.0/ports/libxml2/2.9.2/install.log' to see what happened.
*** extconf.rb failed ***
当我查看install.log的内容时,我看到了:
make install-recursive
Making install in include
Making install in libxml
make[4]: Nothing to be done for `install-exec-am'.
../.././install-sh -c -d '/usr/local/rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin12.6.0/libxml2/2.9.2/include/libxml2/libxml'
/usr/bin/install -c -m 644 SAX.h entities.h encoding.h parser.h parserInternals.h xmlerror.h HTMLparser.h HTMLtree.h debugXML.h tree.h list.h hash.h xpath.h xpathInternals.h xpointer.h xinclude.h xmlIO.h xmlmemory.h nanohttp.h nanoftp.h uri.h valid.h xlink.h xmlversion.h DOCBparser.h catalog.h threads.h globals.h c14n.h xmlautomata.h xmlregexp.h xmlmodule.h xmlschemas.h schemasInternals.h xmlschemastypes.h xmlstring.h xmlunicode.h xmlreader.h relaxng.h dict.h '/usr/local/rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin12.6.0/libxml2/2.9.2/include/libxml2/libxml'
install: /usr/local/rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin12.6.0/libxml2/2.9.2/include/libxml2/libxml/SAX.h: Permission denied
make[4]: *** [install-xmlincHEADERS] Error 71
make[3]: *** [install-am] Error 2
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2
根据类似问题的其他答案提示,我已经运行:
$ gem update --system
brew update
gem install nokogiri
我还能尝试什么?