Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle error on OS X

This is the error log, when i use bundle install.

I want to construct a blog in Github, so use Octopress, but it was unsuccessful. 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.
like image 767
ciqi shu Avatar asked Dec 30 '14 03:12

ciqi shu


People also ask

Is bundle the same as bundle install?

The commands bundle & bundle install also have the same functionality. bundle uses Thor, and bundle 's default task is install . Also, bundle i does the same thing as bundle install because bundle 's task i is mapped (aliased) to install .

What does bundle exec mean?

bundle exec is a Bundler command to execute a script in the context of the current bundle (the one from your directory's Gemfile). rake db:migrate is the script where db is the namespace and migrate is the task name defined.

What is the difference between bundle install and bundle update?

bundle update and bundle install can both install the gems you specified in Gemfile but missing in gems. But bundle update does one thing more to upgrade: If the gems specified in Gemfile don't have version, it will upgrade to whatever latest.


3 Answers

This fixed the issue for me.

xcode-select -s /Library/Developer/CommandLineTools/
like image 162
harsh_v Avatar answered Sep 25 '22 17:09

harsh_v


It looks like maybe your Mac doesn't have xcode command line tools installed. 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.

like image 34
davetakahashi Avatar answered Sep 25 '22 17:09

davetakahashi


Occur same issue after run sudo gem install cocoapods on my new m1 macbook pro.

↓This fix issue for me too.

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

if you doesn't have CommandLineTools folder, just run xcode-select --install

like image 26
nowater tony Avatar answered Sep 24 '22 17:09

nowater tony