新手问题 xcode4.3.3 配置 rails 问题 难道社区 wiki 配置 rails 有问题

Jsiguo · 2012年08月09日 · 最后由 ysihaoy 回复于 2012年09月16日 · 8116 次阅读

mac 10.7.4 按照 wiki 文档执行 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr 出现如下提示

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.4, Xcode 4.3.3.

For MacRuby: Install LLVM first. 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' You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer. We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup. To use an RVM installed Ruby as default, instead of the system ruby:

:

请问该如何解决

匿名 #2 2012年08月09日

不是说了么 The only fix is to install Xcode over osx-gcc-installer

xcode 已经装了啊

这个我之前装的时候也遇到过 打开 xcode=> preference => downloads => Command Line Tools 安装这个。

提示不是写的很清楚吗

  • brew install libksba (没有 brew 先去安装个 brew,这个差不多是标配了)
  • 下载 https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg 这个包,安装之。

    不过安装过这个之后安装 nodejs 会出现编译错误,解决方法是重新安装 xcode 的 command line tools。(貌似不止安装 node 会出现 make 不能编译的问题,很多时候都会出现,解决办法就是重新安装 CLT)

  • 接着 rvm install 1.9.3 就可以了

折腾了 很久,按照四楼 5 楼的操作了电脑也重启过但还是报最开始贴的提示 唉,郁闷

貌似 xcode 4.3.3 配置 rails 很有问题,谁这样配置过,有没有好点的帖子

我也是 4 楼那样的办法搞好了

#7 楼 @Jsiguo 试下手动设置 xcode_path

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

gcc -v Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

rvm install 1.9.2 --with-readline-dir=$rvm_path/usr 提示 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.4, Xcode 4.3.3.

For MacRuby: Install LLVM first.

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'

You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.

We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup.

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

本机系统 Mac OS X 10.7.4 Xcode 4.3.3. 按照 9 楼手动设置也试过了还是这样

有谁能帮我解答下,谢谢!万分感谢,想搞 rails 环境问题很郁闷

各种方式都试过了 gcc brew install libksba 打开 xcode=> preference => downloads => Command Line Tools 安装这个 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 等都试过了 执行 rvm install 1.9.2 --with-readline-dir=$rvm_path/usr 还是报最开始贴的东西 难道人品问题 哎。。。。

各种诡异 按照各位的建议都试过了还是报最开始贴的东西

#13 楼 @Jsiguo 不加这个 --with-readline-dir=$rvm_path/usr 试试,

我在 .rvm/usr 下也没找到 readline 啊

不加这个 我直接执行的 rvm install 1.9.3 也是我最开始贴的同样的提示 我的 xcode4.3.3

#14 楼 @diudiutang 还有什么办法吗????

你没有加载 rvm 到环境变量 加上这句到你的 .bash_profile 或者 .zshrc 里面

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

再 source 下之后试试

#18 楼 @diudiutang 哥们儿 刚执行 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" source ~/.bash_profile rvm install 1.9.3 --with-readline-dir=$rvm_path/usr 同样报最开始贴的东西 还在郁闷中。。。。。

#19 楼 @Jsiguo 提示貌似说 only ruby-1.9.3-0125+ is partially supported ,让你降到 4.1 版本 或者 卸载 Xcode 装 osx-gcc-installer , 你到底装了 gcc-4.2 那个包没。。

#21 楼 @Jsiguo 。。。按说我也是这么装的,开始也是这个提示,把必要的都装了之后就很顺利了。。

难道非要重装 mac 系统 重装 xcode4.1 才能配置 rails

#23 楼 @Jsiguo 。重装下 Xcode 试试,我装 ImageMagick 的时候也是遇到各种问题,一个最主要的问题就是 make ,把 Command Line Tools 重装了下就顺利结局了。可能还是编译器的问题 不过我的系统是 ml, Xcode 版本 4.4

#24 楼 @diudiutang Command Line Tools 如何重装

装了 xcode 的 command line tools 之后,再安装 homebrew,然后按照这篇文章操作就行了 http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/

我用的 4.4 版本的 Xcode, 好像 developer.apple.com 上有单独的,我也不知道在哪。。我是直接下载别人上传的一般版本 4.4 Xcode 里面带的

https://www.dropbox.com/sh/pneetxuvlljc6m0/jlRLmI4MBo/xcode44cltools_10_86938106a.dmg

#26 楼 @IchiNiNiIchi 这是咋回事 之前执行过 brew install libksba

https://github.com/mxcl/homebrew/issues/6886 I reverted the install script. Either reinstall or make /usr/local writable for your user.

#26 楼 @IchiNiNiIchi brew -v Homebrew 0.9.2

#30 楼 @Jsiguo 现在可以 brew doctor 看下系统环境,好像推荐每次 brew install 之前最好都 doctor 下

能不能贴一下 ls -dl /usr/local 跟 ls -dl /usr/local/.git 的结果

#34 楼 @IchiNiNiIchi ls -dl /usr/local drwxr-xr-x 10 root wheel 340 8 11 18:56 /usr/local

#34 楼 @IchiNiNiIchi ls -dl /usr/local/.git ls: /usr/local/.git: No such file or directory 貌似文件没有

最简单的方法就是重新安装一次 homebrew 或者你试一下以下的代码

sudo chmod 777 /usr/local
cd /usr/local
git remote add git://github.com/mxcl/homebrew.git
git reset --hard
git clean -f -d
git pull origin master
brew update
sudo chmod 775 /usr/local

#37 楼 @Jsiguo 看来的确是写权限的问题。。brew doctor 是个好东西

#38 楼 @IchiNiNiIchi git remote add git://github.com/mxcl/homebrew.git 之后报如下 fatal: Not a git repository (or any of the parent directories): .git 还要执行 git reset --hard git clean -f -d git pull origin master brew update sudo chmod 775 /usr/local 这些吗

很好奇你是怎么安装 homebrew 的 要不你试着运行一下 homebrew 的安装脚本吧 ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)

一个题外话,LZ 怎么不升级操作系统呢? 新买的 mac 应该还可以免费升级

#43 楼 @IchiNiNiIchi 系统 10.7.4 难道还要升级到 10.8 😉

#43 楼 @IchiNiNiIchi 据说 10.8 系统续航有问题

#42 楼 @Jsiguo 把 Library 下的 Homebrew 目录完全删除,再安装试试?

#46 楼 @IchiNiNiIchi Library 貌似隐藏着的,defaults write com.apple.finder AppleShowAllFiles -bool true 显示隐藏文件貌似也没用,请问还有什么方式可以删除

#47 楼 @Jsiguo Homebrew 不是安装在 /usr/local/Library/ 下吗。

你修复下磁盘权限,看你这系统各种问题。。

其实本质就是编译器的问题,因为现在 苹果的 gcc 是 llvm,xcode 4.2 改的版,把 gcc 和一些编译工具去掉了。但是如果你要编译东西要用 xcode 里面的 command line 或者去下载 osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer

#47 楼 @Jsiguo 要不你试试下面的脚本

sudo chmod 777 /usr/local
cd /usr/local
git init
git remote add git://github.com/mxcl/homebrew.git
git reset --hard
git clean -f -d
git pull origin master
brew update
sudo chmod 775 /usr/local

希望你能解决你的问题,睡觉去了,晚安

rvm alias create default 1.9.3

rvm --default use ruby-1.9.3

需要 登录 后方可回复, 如果你还没有账号请 注册新账号