11

私は以前にこれに関する多くの投稿を見て、彼らの指示に従ったが、何も機能していない。私が行ったことの概要を以下に示します。私が従う手順は、アドバイスをいただければ幸いです。

次のインストール手順に従いました:http: //pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac

OSX Mountain LionのXコードをダウンロードし、gccコンパイラをインストールしました。

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

その後、指示どおりに実行し、最新バージョンのgitをインストールしました

$ git --version
git version 1.7.10.2 (Apple Git-33)

同様に、コマンドラインを介してrvmで同じことを行います。

$ rvm --version
rvm 1.16.13 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

次に、RVMを使用してrubyをインストールしようとすると、次のようになります。

$ rvm install 1.9.3
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p286.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.

代替コマンドラインを使用すると、いくつかの追加ビットがありますが、同様の出力が得られます。

$ rvm install 1.9.3 --with-gcc=clang
-bash: -dumpversion: command not found
-bash: --version: command not found
-bash: --version: command not found
Installing Ruby from source to: /Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286, this may take a while depending on your cpu(s)...
ruby-1.9.3-p286 - #downloading ruby-1.9.3-p286, this may take a while depending on your connection...
ruby-1.9.3-p286 - #extracted to /Users/mondemoo/.rvm/src/ruby-1.9.3-p286 (already extracted)
ruby-1.9.3-p286 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang', please read /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
-bash: --version: command not found

configure.logsを調べると、次のようになります。

$ less /Users/mondemoo/.rvm/log/ruby-1.9.3-p286/configure.log
[2012-10-17 07:39:15] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/mondemoo/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/mondemoo/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking target system type... x86_64-apple-darwin12.2.0
checking whether the C compiler works... no
configure: error: in `/Users/mondemoo/.rvm/src/ruby-1.9.3-p286':
configure: error: C compiler cannot create executables
See `config.log' for more details

私は今、私が間違ったことをしたことについて完全に混乱しています-誰かが助けることができますか?c-compiler(gcc?)に問題があるようですが、正しく解釈されていますか?もしそうなら、どうすればそれを修正できますか?また、上記のconfigure.logに記載されているこの「config.log」にアクセスするにはどうすればよいですか?

ありがとう!

4

2 に答える 2

22

これはRailsInstallerOSX1.0.3のバグです-https ://github.com/railsinstaller/railsinstaller-nix/issues/10

/etc/rvmrcこれを含むように変更する必要があります。

umask g+w
export -a rvm_configure_env
rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')

バイナリルビーが2.0.0で利用可能になったら、新しいバージョンのインストーラーを準備します。

更新:新しいバージョンのRVMの場合は、次の1.19+ /etc/rvmrcように変更する必要があります。

umask g+w
export rvm_autolibs_flag=smf

そして実行しますrvm get stabel #OR: head

于 2012-10-17T07:13:45.043 に答える
1

「正しい」方法で行ったかどうかはわかりませんが、RVM(rvm implode)を削除してから再インストールし(\ curl -L https://get.rvm.io | bash -s stable --ruby)、インストールしました現在、最新バージョンのruby1.9.3-p327を問題なく実行しています。

于 2012-11-17T17:40:12.187 に答える