ruby-on-rails - 在框架“ruby”中没有找到头文件“config.h”?
问题描述
我最近买了一台新机器,并决定创建一个新的 rails 应用程序。我正在使用 rbenv。
当我运行时,rails new
一切都开始创建,但没有完成,而是给了我通知说
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle config set --local path 'vendor/bundle'
bundle install
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.
所以我然后取消了安装并运行了这两个命令。我跑的时候没有问题bundle config set --local path 'vendor/bundle'
,但是当我跑的时候,我bundle install'
得到了一个新的错误说明:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/username/Desktop/testAppHere/vendor/bundle/ruby/2.6.0/gems/racc-1.6.0/ext/racc/cparse
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20211108-45990-wfqxs3.rb extconf.rb
checking for rb_block_call()... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
{lots of log files I don't think are needed}
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/Users/name/Desktop/testAppHere/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/racc-1.6.0/mkmf.log
所以我去了那个文件,感觉不是很有帮助,除了我在那里看到的一行
note: did not find header 'config.h' in framework 'ruby' (loaded from '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
有谁知道我在这里做错了什么?我有点想在几个项目上编码,但在这里被阻止了
解决方案
推荐阅读
- java - iText 无法处理 1.3gb PDF 文件
- swift - 带有自动布局的 ScrollView 问题 Xcode 11.X
- casting - LLVM 通过将整数转换为浮点数
- oracle - sqlplus 复制命令的密码无效,但它是正确的密码。请指导我
- javascript - TypeError:无法读取反应中未定义的属性“页面”
- windows - Windows 10 上的 Turbo Assembler 16 位编译器
- python - GridSearchCV 和树分类器
- jenkins - 如何只运行选定的作业?
- azure - 无法删除 azure apim api
- javascript - List.js addEventListener 和 .on() 不起作用