0

私は誓う、stackoverflowにRubyをインストールすることについてのすべての議論を見てきました...何も役に立ちませんでした。Xcode4.1とrvm1.16.19をインストールしています。

libksbaがインストールされています。

どういうわけかインストールされているRubyのバージョンがいくつかありますが、どのバージョンかわかりません-任意の種類のRubyコマンドを実行すると、「ruby」自体、「ruby --version」など、何も応答がありません。 ctrl/cする必要があるプロンプトが表示されます。

RVMを使用しているかどうかに関係なく、Rubyのいずれかのバージョンをインストールしようとすると、次の出力が表示されます。

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/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286', please read /Users/Dauber/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
ruby-1.9.3-p286 is not installed.

前述のconfigure.logからの出力は次のとおりです。

[2012-11-08 20:46:41] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

奇妙なことに、システムには「config.log」というファイルがどこにも存在しないため、「詳細」を「見る」ことができません。

もう1つの奇妙なこと...私はgccとgcc-4.2を使用してこのマシンで数十のCプログラムをコンパイルしました-そして私はもう一度試しましたが、それらは正常に動作するので、取引が何であるか正確にはわかりません...

https://github.com/kennethreitz/osx-gcc-installerからインストールしようとしましたが無駄になりました。まったく違いはありませんでした。

これはすべて、OSX10.7.5を実行している私のMacBookにあります。奇妙なことに...まったく同じバージョンのLionを実行しているiMacで問題が発生したことはありません...実際、Rubyをインストールする必要すらありませんでした。たまたま1.9.2がインストールされていました。Railsを追加するだけで、すべてが完璧に機能しました... MacBookでこのようなものを機能させることができないほど、一体何が違うのでしょうか?

PRUSSWANのリンク後:簡単に言うと、リンクされている他の投稿のprusswanは、Railsインストーラーにバグがあり、/ etc/rvmrcを変更する必要があると述べています。変更を加えましたが、rubyをインストールしようとしたときに以前とまったく同じエラーメッセージが表示されました。ただし、これはconfigure.logが現在言っていることです。

[2012-11-08 22:42:08] env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
current path: /Users/Dauber/.rvm/src/ruby-1.9.3-p286
command(8): env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.2 accepts -g... yes
checking for gcc-4.2 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.2 accepts -g... yes
checking how to run the C preprocessor... gcc-4.2 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc-4.2 needs -traditional... no
checking whether the linker is GNU ld... no
checking whether gcc-4.2 -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p...  -d
use 'mkdir -p' as MKDIR_P
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether -Wno-unused-parameter is accepted... yes
checking whether -Wno-parentheses is accepted... yes
checking whether -Wno-long-long is accepted... yes
checking whether -Wno-missing-field-initializers is accepted... yes
checking whether -Werror=pointer-arith is accepted... yes
checking whether -Werror=write-strings is accepted... yes
checking whether -Werror=declaration-after-statement is accepted... yes
checking whether -Werror=shorten-64-to-32 is accepted... yes
checking whether -Werror=implicit-function-declaration is accepted... yes
checking whether -Wall -Wextra is accepted... yes
checking whether -ggdb is accepted... yes
checking whether -fvisibility=hidden is accepted... yes
checking whether -Wl,-unexported_symbol,_Init_* is accepted... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... inline
checking for working volatile... yes
checking for long long... yes
checking for off_t... yes
checking char bit... ./configure: line 8508: syntax error near unexpected token `rb_cv_char_bit,'
./configure: line 8508: `    AC_COMPUTE_INT(rb_cv_char_bit, CHAR_BIT,'

したがって、生成された./configureファイルはタイプミスなどで生成されたように見えます...

4

2 に答える 2

0

うわー...信じられないけど、自分の質問に対する答えを見つけたんだ。とても当たり前だった。

「rvm remove」コマンドを使用するべきでした。それを試してみると、魔法のように、Ruby のすべてのバージョンを心ゆくまでインストールできるようになりました。

次に、Aptana で新しい Rails プロジェクトを作成できるかどうかを確認します。:)

フィードバックをお寄せいただきありがとうございます。

于 2012-11-09T12:52:14.353 に答える
0

RVM を使用して Ruby をセットアップする方法を説明するこのガイドに従ってください。

于 2012-11-09T03:13:26.773 に答える