2012-11-23 61 views
3

首先,很多人提前感谢您的帮助。我是一个有编程的完全新手,我正在尝试开始使用这个Ruby on Rails教程(http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2)用Ruby for Mac OS X 10.7.5完成ruby 1.9.3的安装Leopard,Xcode 4.5.2 - rvm pkg安装问题openssl

我一直在试图解决这个问题约7小时,因为我没有任何头发留下来拉出我转向这些神圣的页面。我一遍又一遍地寻找解决方案。

系统:Mac OS X 10.7.5 Leopard中的Xcode 4.5.2

我安装自制软件和更新了其多次 我用自制安装RVM并更新它多次 我安装的git

系统上的标准红宝石(检查$ ruby​​ -v)是1.8.7

我的问题是,每次我尝试使用rvm来安装新版本的Ruby($ rvm install 1.9.3)我收到以下错误:

Ruby (and needed base gems) for your selection will be installed shortly. 
Before it happens, please read and execute the instructions below. 
Please use a separate terminal to execute any additional commands. 

    Notes for Mac OS X 10.7.5, Xcode 4.5.2. 

For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" 
For IronRuby: Install Mono >= 2.6 
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' 
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/ 

To use an RVM installed Ruby as default, instead of the system ruby: 

    rvm install 1.8.7 # installs patch 357: closest supported version 
    rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems 
    rvm alias create default 1.8.7 

And reopen your terminal windows. 

Xcode and gcc: 

: 

我已经执行了$ brew安装libksba,当我尝试再次执行它时,它告诉我libksba已经安装。

当我输入“$ RVM要求”我得到:

 Notes for Mac OS X 10.7.5, Xcode 4.5.2. 

For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" 
For IronRuby: Install Mono >= 2.6 
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' 
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/ 

To use an RVM installed Ruby as default, instead of the system ruby: 

    rvm install 1.8.7 # installs patch 357: closest supported version 
    rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems 
    rvm alias create default 1.8.7 

And reopen your terminal windows. 

Xcode and gcc: 

Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2. 

Xcode 4.1 and earlier: 
- Ruby will build fine. 

Xcode 4.2 and later (including Command Line Tools for Xcode): 
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine. 
- If you don't have gcc-4.2, you have two options to get it: 
* Install apple-gcc42 from Homebrew 
* Install osx-gcc-installer 

    Homebrew: 

    If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes: 

     brew update 
     brew tap homebrew/dupes 
     brew install autoconf automake apple-gcc42 
     rvm pkg install openssl 

    Xcode 4.2+ install or/and Command Line Tools for Xcode is required to provide make and other tools. 

    osx-gcc-installer: 

    If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer. 

    Warning: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire. 

    ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer. 

所以,我认为我必须做 冲泡更新 冲泡自来水自制的东西/愚弄 酿造安装的autoconf automake的苹果gcc42 RVM PKG安装OpenSSL的

一切似乎都正常工作,直到 “$ RVM PKG安装OpenSSL的”,它返回:

Fetching openssl-1.0.1c.tar.gz to /Users/thierinvestmentservices/.rvm/archives 
Extracting openssl to /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c 
Configuring openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. 
Compiling openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. 
Error running 'make', please read /Users/thierinvestmentservices/.rvm/log/openssl/make.log 

Please note that it's required to reinstall all rubies: 

    rvm reinstall all --force 

Updating openssl certificates 
Error running 'update_openssl_certs', please read /Users/thierinvestmentservices/.rvm/log/openssl.certs.log 
Johns-MacBook-Pro:~ thierinvestmentservices$ rvm pkg install openssl 
Fetching openssl-1.0.1c.tar.gz to /Users/thierinvestmentservices/.rvm/archives 
Extracting openssl to /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c 
Configuring openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. 
Compiling openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. 
Error running 'make', please read /Users/thierinvestmentservices/.rvm/log/openssl/make.log 

Please note that it's required to reinstall all rubies: 

    rvm reinstall all --force 

Updating openssl certificates 
Error running 'update_openssl_certs', please read /Users/thierinvestmentservices/.rvm/log/openssl.certs.log 

make.log里读取

"[2012-11-23 13:15:28] make 
/Users/thierinvestmentservices/.rvm/scripts/functions/utility: line 116: make: command not found" 

和openssl.certs.log读取

"[2012-11-23 14:04:04] update_openssl_certs 
update_openssl_certs() 
{ 
    (chpwd_functions="" builtin cd $rvm_usr_path/ssl && command curl -O http://curl.haxx.se/ca/cacert.pem && mv cacert.pem cert.pem) 
} 
current path: /Users/thierinvestmentservices 
command(1): update_openssl_certs 
/Users/thierinvestmentservices/.rvm/scripts/functions/pkg: line 205: cd: /Users/thierinvestmentservices/.rvm/usr/ssl: No such file or directory" 

在这一点上的字母很可能会成为宋体我不知道是怎么回事。我试图安装rvm make,在一个论坛帖子中看到的东西,但我得到了一堆警告。如果任何人有任何建议,我会深表感激,我完全在我的头上。


根据以下的建议,我尝试重新安装rvm。键入“rvm全部重新安装 - 强制”没有做任何事情(它只是给了我一个新的终端线)。所以,我做了搜索,使用RVM破灭,然后每https://rvm.io/rvm/install/重新安装得到了下面的消息出来的RVM的安装:

.....

Error running '__rvm_package extract /Users/thierinvestmentservices/.rvm/archives/yaml-0.1.4.tar.gz /Users/thierinvestmentservices/.rvm/src', please read /Users/thierinvestmentservices/.rvm/log/ruby-1.9.3-p327/yaml/extract.log 
There has been an error while trying to extract the source. Halting the installation. 
Installing Ruby from source to: /Users/thierinvestmentservices/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)... 
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection... 
tee: /Users/thierinvestmentservices/.rvm/log/ruby-1.9.3-p327/fetch.log: Permission denied 
/Users/thierinvestmentservices/.rvm/scripts/functions/utility: line 116: /Users/thierinvestmentservices/.rvm/log/ruby-1.9.3-p327/fetch.log: Permission denied 
Error running '/Users/thierinvestmentservices/.rvm/scripts/fetch http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.bz2', please read /Users/thierinvestmentservices/.rvm/log/ruby-1.9.3-p327/fetch.log 
There has been an error fetching the ruby interpreter. Halting the installation. 
ruby-1.9.3-p327 is not installed. 
Creating alias default for ruby-1.9.3-p327. 
Recording alias default for ruby-1.9.3-p327. 
Creating default links/files 
ruby-1.9.3-p327 is not installed. 
Could not load ruby ruby-1.9.3-p327. 
/Users/thierinvestmentservices/.rvm/scripts/alias: line 111: /Users/thierinvestmentservices/.rvm/rubies/ruby-1.9.3-p327/bin/ruby: No such file or directory 

    * To start using RVM you need to run `source /Users/thierinvestmentservices/.rvm/scripts/rvm` 
    in all your open shell windows, in rare cases you need to reopen all shell windows. 

    * To start using rails you need to run `rails new <project_dir>`. 

RVM安装1.9。3让我在同一个地方之前:

Ruby (and needed base gems) for your selection will be installed shortly. 
Before it happens, please read and execute the instructions below. 
Please use a separate terminal to execute any additional commands. 

    Notes for Mac OS X 10.7.5, Xcode 4.5.2. 

For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" 
For IronRuby: Install Mono >= 2.6 
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' 
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/ 

To use an RVM installed Ruby as default, instead of the system ruby: 

    rvm install 1.8.7 # installs patch 357: closest supported version 
    rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems 
    rvm alias create default 1.8.7 

And reopen your terminal windows. 

Xcode and gcc: 

: 

RVM要求和RVM PKG安装OpenSSL的也让我同样的确切地点。最好,J

+0

你是否执行过rvm重新安装所有--force? – awenkhh

+0

键入rvm重新安装所有--force没有做任何事情(它只是给了我一个新的终端线)。所以我做了搜索并使用了rvm implode,然后通过https://rvm.io/rvm/install/重新安装,结果发布为编辑 – jedidingo

+0

以上似乎您有权限问题:tee:/Users/thierinvestmentservices/.rvm/ log/ruby​​-1.9.3-p327/fetch.log:权限被拒绝 /Users/thierinvestmentservices/.rvm/scripts/functions/utility:第116行:/Users/thierinvestmentservices/.rvm/log/ruby-1.9.3- p327/fetch.log:权限被拒绝 - 您是否尝试以sudo用户身份执行所有操作? – awenkhh

回答

3
在Xcode

您需要安装的命令行工具,但是...更简单的方法是安装OSX,GCC的安装程序,它包括所有需要的库,编译器和仅仅是一个包

+3

你是天赐mpapis!我做了Xcode>首选项>下载>命令行工具!然后回到“$ rvm pkg install openssl”,它终于运行,然后sudo $ rvm install 1.9.3工作。我离开了,并与教程一起运行。我完全被难倒了,你修好了。希望有一天我能帮助你的人,就像你帮助我一样。非常感谢! – jedidingo

0

你可以去:

http://connect.apple.com

直从苹果公司获得最新的命令行工具。如果您使用的是Homebrew,您可能需要按照Homebrew的建议完全安装Xcode。