gpt4 book ai didi

ruby-on-rails - 在 mac 上安装 rails 失败错误 : Failed to build gem native extension

转载 作者:数据小太阳 更新时间:2023-10-29 08:12:36 26 4
gpt4 key购买 nike

我下载了 xcode、命令行工具、home brew、rvm 和 ruby​​,但是当我使用命令 sudo gem install rails 时,我收到一条错误消息。不知道该怎么做,任何帮助都很好,我想在我的新 Mac 上安装 Rails。

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/cheatermoves/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.14/test/test_atomic.rb
marshalls-MacBook-Air:~ cheatermoves$ sudo gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
*** 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=/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:26:in `<main>'

最佳答案

您可能不想将 sudo 与 RVM 一起使用...尝试:

gem install rails

关于ruby-on-rails - 在 mac 上安装 rails 失败错误 : Failed to build gem native extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19075236/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com