当我在命令行中运行which ruby
时,它会返回/Applications/MAMP/Library/bin//ruby
。
在两个方面似乎这是错误的 - 我的Ruby安装是否应该在MAMP文件夹中?如果是这样,我该如何移动呢?
如果可以住在那里,我该如何解决双//
问题?我试过在Finder中查看文件目录,但它没有显示路径,我也不知道如何在命令行上修复它。
这次调查的原因是因为我试图在Rails应用程序中运行bundle install
,并且不断出现这种情况 -
安装inconv(1.0.4)时发生错误,Bundler无法继续。确保
gem install iconv -v '1.0.4
'在捆绑之前成功。
当我尝试手动安装该gem时,它会失败。出现以下错误消息 -
gem install iconv -v '1.0.4'
Building native extensions. This could take a while...
ERROR: Error installing iconv:
ERROR: Failed to build gem native extension.
current directory: /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/iconv-1.0.4/ext/iconv
/Applications/MAMP/Library/bin/ruby -r ./siteconf20170605-25107-o5fym5.rb extconf.rb
checking for rb_enc_get() in ruby/encoding.h... yes
checking for rb_sys_fail_str() in ruby.h... yes
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Applications/MAMP/Library/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Applications/MAMP/Library/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-13/2.3.0-static/iconv-1.0.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/iconv-1.0.4 for inspection.
Results logged to /Applications/MAMP/Library/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-13/2.3.0-static/iconv-1.0.4/gem_make.out
我在网上找到的每个修补程序都试图解决Bundler问题也不起作用 - 所以我想知道它失败的原因是因为Ruby位置问题吗?
提前感谢您的帮助!对不起,如果我措辞严重或错过任何重要的事情 - 我对编码很新,所以仍然能够绕过一切!