実現したいこと
rbenvを使ってrubyをインストールしたいです。
エラーに自力では対処できず、ご協力をお願いします。
試したこと1
下記を参考にコマンドを使用しました。
(rbenv installでconfigure: error: C compiler cannot create executablesが出た時の対処法)[http://www.cl9.info/entry/2018/05/17/111918]
$ CC=/usr/bin/gcc bundle install
のコマンドを打つと下記のエラーとなりました。
-bash: bundle: command not found
試したこと2
下記を参考にコマンドを使用しました。
(Rdenvを使ってrubyをインストール)[http://hermesian.hatenablog.com/entry/2014/02/21/131115]
apt-cyg remove gcc-core
のコマンドを打つと下記のエラーとなりました。
-bash: apt-cyg: command not found
試したこと3
checking whether the C compiler works... no
より、
C言語をコンパイルする時にエラーが出ている。
そのため、GCCのインストールを行うことができれば、解決できるのでは、と考えています。
下記の方法でGCCのインストールを試みましたが、おそらく失敗している模様です。
(Macのgcc, g++をHomebrewを使って最新版にする)[https://qiita.com/wawawa/items/50c2c612b0937f28d92b]
$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin $ g++ -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ターミナルでのエラー
$ rbenv install 2.5.1 ruby-build: use openssl from homebrew Downloading ruby-2.5.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 Installing ruby-2.5.1... ruby-build: use readline from homebrew BUILD FAILED (OS X 10.14.4 using ruby-build 20190130) Inspect or clean up the working tree at /var/folders/d6/0hgvlg7n40q_yw0z_j8kj3600000gn/T/ruby-build.20190510232145.56432 Results logged to /var/folders/d6/0hgvlg7n40q_yw0z_j8kj3600000gn/T/ruby-build.20190510232145.56432.log Last 10 log lines: tool/config.guess already exists tool/config.sub already exists checking build system type... x86_64-apple-darwin18.5.0 checking host system type... x86_64-apple-darwin18.5.0 checking target system type... x86_64-apple-darwin18.5.0 checking whether the C compiler works... no configure: error: in `/var/folders/d6/0hgvlg7n40q_yw0z_j8kj3600000gn/T/ruby-build.20190511105021.1635/ruby-2.5.1': configure: error: C compiler cannot create executables See `config.log' for more details make: *** No targets specified and no makefile found. Stop.
cofig.logの内容
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure --prefix=/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1 --with-openssl-dir=/usr/local/opt/openssl --with-readline-dir=/usr/local/opt/readline ## --------- ## ## Platform. ## ## --------- ## hostname = yu-kiwatanabe-no-MacBook-Pro.local uname -m = x86_64 uname -r = 18.5.0 uname -s = Darwin uname -v = Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 /usr/bin/uname -p = i386 /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = Mach kernel version: Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 Kernel configured for up to 4 processors. 2 processors are physically available. 4 processors are logically available. Processor type: x86_64h (Intel x86-64h Haswell) Processors active: 0 1 2 3 Primary memory available: 16.00 gigabytes Default processor set: 409 tasks, 1974 threads, 4 processors Load average: 2.80, Mach factor: 1.66 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/Cellar/rbenv/1.1.1/libexec PATH: /Users/yu-kiwatanabe 1/.rbenv/shims PATH: /Users/yu-kiwatanabe 1/.rbenv/bin PATH: /Users/yu-kiwatanabe 1/.rbenv/shims PATH: /Users/yu-kiwatanabe 1/.rbenv/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/sbin PATH: /sbin PATH: /opt/X11/bin PATH: /usr/local/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2962: checking for ruby configure:2980: found /usr/bin/ruby configure:2993: result: /usr/bin/ruby configure:3079: checking build system type configure:3093: result: x86_64-apple-darwin18.5.0 configure:3181: checking host system type configure:3194: result: x86_64-apple-darwin18.5.0 configure:3214: checking target system type configure:3227: result: x86_64-apple-darwin18.5.0 configure:3888: checking for C compiler version configure:3897: clang --version >&5 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin configure:3908: $? = 0 configure:3897: clang -v >&5 Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin configure:3908: $? = 0 configure:3897: clang -V >&5 clang: error: unsupported option '-V -Wno-atomic-implicit-seq-cst' clang: error: no input files configure:3908: $? = 1 configure:3897: clang -qversion >&5 clang: error: unknown argument '-qversion', did you mean '--version'? clang: error: no input files configure:3908: $? = 1 configure:3928: checking whether the C compiler works configure:3950: clang -I/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1/include -L/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1/lib conftest.c >&5 clang: error: no such file or directory: '1/.rbenv/versions/2.5.1/include' clang: error: no such file or directory: '1/.rbenv/versions/2.5.1/lib' configure:3954: $? = 1 configure:3992: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define CANONICALIZATION_FOR_MATHN 1 | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3997: error: in `/var/folders/d6/0hgvlg7n40q_yw0z_j8kj3600000gn/T/ruby-build.20190511000829.58813/ruby-2.5.1': configure:3999: error: C compiler cannot create executables See `config.log' for more details ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-apple-darwin18.5.0 ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set=set ac_cv_env_CC_value=clang ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set=set ac_cv_env_CPPFLAGS_value='-I/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1/include ' ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set= ac_cv_env_CXX_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value='-L/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1/lib ' ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_cflags_set= ac_cv_env_cflags_value= ac_cv_env_cppflags_set= ac_cv_env_cppflags_value= ac_cv_env_cxxflags_set= ac_cv_env_cxxflags_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=x86_64-apple-darwin18.5.0 ac_cv_path_BASERUBY=/usr/bin/ruby ac_cv_prog_CC=clang ac_cv_target=x86_64-apple-darwin18.5.0 ## ----------------- ## ## Output variables. ## ## ----------------- ## ALLOCA='' AR='' ARCHFILE='' ARCH_FLAG='' ARFLAGS='' AS='' ASFLAGS='' ASMEXT='' BASERUBY='/usr/bin/ruby --disable=gems' BOOTSTRAPRUBY='' BTESTRUBY='' BUILTIN_ENCOBJS='' BUILTIN_TRANSOBJS='' BUILTIN_TRANSSRCS='' CAPITARGET='' CC='clang' CCDLFLAGS='' CC_VERSION='' CC_VERSION_MESSAGE='' CFLAGS='' CHDIR='' COMMON_HEADERS='' COMMON_LIBS='' COMMON_MACROS='' CONFIGURE='' COUTFLAG='' CP='' CPP='' CPPFLAGS='-I/Users/yu-kiwatanabe 1/.rbenv/versions/2.5.1/include ' CPPOUTFILE='' CROSS_COMPILING='' CSRCFLAG='' CXX='' CXXFLAGS='' DEFS='' DESTDIR='' DLDFLAGS='' DLDLIBS='' DLEXT2='' DLEXT='' DLLWRAP='' DLNOBJ='' DOT='' DOXYGEN='' DTRACE='' DTRACE_EXT='' DTRACE_OBJ='' DTRACE_OPT='' DTRACE_REBUILD='' ECHO_C='\c' ECHO_N='' ECHO_T='' EGREP='' ENABLE_DEBUG_ENV='' ENABLE_SHARED='' ENCOBJS='' ENCSTATIC='' EXECUTABLE_EXTS='' EXEEXT='' EXPORT_PREFIX='' EXTDLDFLAGS='' EXTLDFLAGS='' EXTOBJS='' EXTOUT='' EXTSTATIC='' GCC='' GIT='git' GNU_LD='' GREP='' HAVE_BASERUBY='yes' 字数制限のため略

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/10 23:27
2019/05/10 23:46
2019/05/11 02:09
2019/05/11 02:25
2019/05/11 04:08