简体   繁体   English

OS X 上的捆绑错误

[英]bundle error on OS X

This is the error log, when i use bundle install .这是错误日志,当我使用bundle install时。

I want to construct a blog in Github, so use Octopress, but it was unsuccessful.我想在Github建一个博客,所以用了Octopress,没成功。 If you have another method, please tell me, thank you.如果您有其他方法,请告诉我,谢谢。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for main() in -lc... yes
creating Makefile

make "DESTDIR="
make: *** No rule to make target `"/Applications/Xcode', needed by `redcloth_attributes.o'.  Stop.


Gem files will remain installed in /var/folders/zb/bxbkz6pd5fscs29zq2hk1b4h0000gn/T/bundler20141230-81071-q2p8fv/RedCloth-4.2.9/gems/RedCloth-4.2.9 for inspection.
Results logged to /var/folders/zb/bxbkz6pd5fscs29zq2hk1b4h0000gn/T/bundler20141230-81071-q2p8fv/RedCloth-4.2.9/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
An error occurred while installing RedCloth (4.2.9), and Bundler cannot
continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.

这为我解决了这个问题。

xcode-select -s /Library/Developer/CommandLineTools/

It looks like maybe your Mac doesn't have xcode command line tools installed.看起来您的 Mac 可能没有安装 xcode 命令行工具。 Try this in the terminal then try bundling again:在终端中尝试此操作,然后再次尝试捆绑:

xcode-select --install

You will also need to accept the license agreement.您还需要接受许可协议。 I think it asks you automatically now.我认为它现在会自动询问您。

Occur same issue after run sudo gem install cocoapods on my new m1 macbook pro.在我的新 m1 macbook pro 上运行sudo gem install cocoapods后出现同样的问题。

↓This fix issue for me too. ↓这个问题也适用于我。

xcode-select --switch /Library/Developer/CommandLineTools/

if you doesn't have CommandLineTools folder, just run xcode-select --install如果您没有 CommandLineTools 文件夹,只需运行xcode-select --install

1-st idea:第一个想法:

Install (update) ruby:安装(更新)ruby:

brew install ruby

And don't forget:并且不要忘记:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

2-nd idea:第二个想法:

Maybe you have to install current (compatible to your XCode) 'Command line tools for XCode'.也许您必须安装当前的(与您的 XCode 兼容)“XCode 命令行工具”。 Google for appropriate Version (if your XCode 11.3 so CommandLineToolsForXcode_11.3).谷歌搜索合适的版本(如果你的 XCode 11.3 所以 CommandLineToolsForXcode_11.3)。

My issue was there is a space in Xcode name我的问题是 Xcode 名称中有一个空格

So I rename the "Xcode 13.1" to "Xcode13.1"所以我将“Xcode 13.1”重命名为“Xcode13.1”

Change the developer tools path using xcode-select switch command使用 xcode-select switch 命令更改开发者工具路径

sudo xcode-select -s /Applications/Xcode13.1.app/Contents/Developer 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM