# Error after calling bundle install (Ruby on Rails installation) (Mac OS X)

**URL:** <https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394>\
**Category:** Rails\
**Created:** [August 6, 2014, 8:34am UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394 "2014-08-06T08:34:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 6, 2014, 8:34am UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394/1 "2014-08-06T08:34:18Z")

</div>

I am trying to initialize a rails application, and I am running into  
some  
issues. When running: rails new . -m  
[https://raw.github.com/RailsApps/rails-composer/master/composer.rb](https://raw.github.com/RailsApps/rails-composer/master/composer.rb)

I run into the issue:

Could not find gem ‘quiet\_assets (\>= 0) ruby’ in the gems available on  
this machine.Run `bundle install` to install missing gems.

When I try to run bundle install, it gives me this error:

An error occurred while installing mysql2 (0.3.16), and Bundler cannot  
continue.Make sure that `gem install mysql2 -v '0.3.16'` succeeds before  
bundling.

When I run that command, I get:

ERROR: Error installing mysql2:  
ERROR: Failed to build gem native extension.

Running

sudo apt-get install mysql-server  
sudo apt-get install mysql-client

I get the error: apt-get: command not found

Any ideas? I have full output below (from where the problems start,  
where  
composer tries to install the bundle of gems):

composer Installing gems. This will take a while.  
run bundle install --without production from "."Fetching gem  
metadata from [https://rubygems.org/........Fetching](https://rubygems.org/........Fetching) additional metadata  
from [https://rubygems.org/..Resolving](https://rubygems.org/..Resolving) dependencies…Using rake  
10.3.2Using i18n 0.6.11Using json 1.8.1Using minitest 5.4.0Using  
thread\_safe 0.3.4Using tzinfo 1.2.1Using activesupport 4.1.4Using  
builder 3.2.2Using erubis 2.7.0Using actionview 4.1.4Using rack  
1.5.2Using rack-test 0.6.2Using actionpack 4.1.4Using mime-types  
1.25.1Using polyglot 0.3.5Using treetop 1.4.15Using mail 2.5.4Using  
actionmailer 4.1.4Using activemodel 4.1.4Using arel  
5.0.1.20140414130214Using activerecord 4.1.4Using addressable 2.3.6Using  
bcrypt 3.1.7Using coderay 1.1.0Using better\_errors 1.1.0Using  
debug\_inspector 0.0.2Using binding\_of\_caller 0.7.2Using sass 3.2.19Using  
bootstrap-sass 3.2.0.1Using bundler 1.6.2Using colorize 0.7.3Using  
net-ssh 2.9.1Using net-scp 1.2.1Using sshkit 1.5.1Using capistrano  
3.0.1Using capistrano-bundler 1.1.2Using capistrano-rails 1.1.0Using  
capistrano-rails-console 0.2.0Using capistrano-rvm 0.1.1Using  
mini\_portile 0.6.0Using nokogiri 1.6.3.1Using xpath 2.0.0Using capybara  
2.4.1Using timers 1.1.0Using celluloid 0.15.2Using ffi 1.9.3Using  
childprocess 0.5.3Using coffee-script-source 1.7.1Using execjs  
2.2.1Using coffee-script 2.3.0Using thor 0.19.1Using railties 4.1.4Using  
coffee-rails 4.0.1Using database\_cleaner 1.3.0Using orm\_adapter  
0.5.0Using warden 1.2.3Using devise 3.2.4Using diff-lcs 1.2.5Using  
factory\_girl 4.4.0Using factory\_girl\_rails 4.4.1Using faker 1.4.2Using  
hike 1.2.3Using multi\_json 1.10.1Using tilt 1.4.1Using sprockets  
2.11.0Using sprockets-rails 2.1.3Using rails 4.1.4Using figaro  
1.0.0.rc1Using formatador 0.2.5Using rb-fsevent 0.9.4Using rb-inotify  
0.9.5Using listen 2.7.9Using lumberjack 1.0.9Using method\_source  
0.8.2Using slop 3.6.0Using pry 0.10.0Using guard 2.6.1Using  
guard-bundler 2.0.0Using guard-rails 0.5.3Using rspec-support 3.0.3Using  
rspec-core 3.0.3Using rspec-expectations 3.0.3Using rspec-mocks  
3.0.3Using rspec 3.0.0Using guard-rspec 4.3.1Using haml  
4.1.0.beta.1Using sexp\_processor 4.4.3Using ruby\_parser 3.1.3Using  
haml2slim 0.4.7Using high\_voltage 2.2.1Using hpricot 0.8.6Using  
html2haml 1.0.1Using hub 1.12.2Using interception 0.5Using jbuilder  
2.1.3Using jquery-rails 3.1.1Using launchy 2.4.2  
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

```
/Users/ ********** /.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb

```

checking for ruby/thread.h… yes  
checking for rb\_thread\_call\_without\_gvl() in ruby/thread.h… yes  
checking for rb\_thread\_blocking\_region()… yes  
checking for rb\_wait\_for\_single\_fd()… yes  
checking for rb\_hash\_dup()… yes  
checking for rb\_intern3()… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lnsl… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lmygcc… no  
checking for mysql\_query() in -lmysqlclient… 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=/Users/**_\*\*\*\*\*\*/.rvm/rubies/ruby-2.1.2/bin/ruby  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysql-config  
–without-mysql-config  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mlib  
–without-mlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-zlib  
–without-zlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-socketlib  
–without-socketlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-nsllib  
–without-nsllib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mygcclib  
–without-mygcclib  
–with-mysqlclientlib  
–without-mysqlclientlib

extconf failed, exit code 1  
Gem files will remain installed in  
/Users/**/.rvm/gems/ruby-2.1.2@myapp/gems/mysql2-0.3.16 for  
inspection.Results logged to  
/Users/ **** /.rvm/gems/ruby-2.1.2@myapp/extensions/x86\_64-darwin-13/2.1.0-static/mysql2-0.3.16/gem\_make.outAn  
error occurred while installing mysql2 (0.3.16), and Bundler cannot  
continue.Make sure that `gem install mysql2 -v '0.3.16'` succeeds before  
bundling.  
composer Updating gem paths.  
WARN: Unresolved specs during Gem::Specification.reset:  
minitest (~\> 5.1)  
rake (\>= 0.8.7)  
WARN: Clearing out unresolved specs.Please report a bug if this causes  
problems.  
composer Stage Two (running recipe ‘stage\_two’ callbacks).  
composer importing html2haml and haml2slim conversion tools  
locale  
gems  
gems recipe stage two  
gems configuring database  
remove config/database.yml  
create config/database.yml  
option Username for MySQL? (leave blank to use the app name) root  
gsub config/database.yml  
option Password for MySQL user root? root  
gsub config/database.yml  
gems set config/database.yml for username/password root/root  
gsub config/database.yml  
gsub config/database.yml  
gsub config/database.yml  
option Okay to drop all existing databases named myapp? ‘No’ will  
abort immediately! (y/n) n  
 [https://raw.github.com/RailsApps/rails-composer/master/composer.rb:1256:in](https://raw.github.com/RailsApps/rails-composer/master/composer.rb:1256:in)  
 `block in apply': aborted at user's request (RuntimeError) from https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in `call’  
from  
 [https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in](https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in)  
 `block in apply' from https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in `each’  
from  
 [https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in](https://raw.github.com/RailsApps/rails-composer/master/composer.rb:2127:in)  
 `apply' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/actions.rb:223:in `instance\_eval’  
from  
/Users/ **_** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/actions.rb:223:in  
 `apply' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/gems/railties-4.1.4/lib/rails/generators/app_base.rb:144:in `apply\_rails\_template’  
from (eval):1:in `apply_rails_template' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/command.rb:27:in `run’  
from  
/Users/ **_** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/invocation.rb:126:in  
 `invoke_command' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke\_all’  
from  
/Users/ **_** /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/invocation.rb:133:in  
 `each' from /Users/ ************ /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map’  
from  
/Users//.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/invocation.rb:133:in  
 `invoke_all' from /Users/ ************* /.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch’  
from  
/Users//.rvm/gems/ruby-2.1.2@myapp/gems/thor-0.19.1/lib/thor/base.rb:440:in  
 `start' from /Users/ ************* /.rvm/gems/ruby-2.1.2@myapp/gems/railties-4.1.4/lib/rails/commands/application.rb:17:in `\<top (required)\>’  
from  
/Users//.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core\_ext/kernel\_require.rb:73:in  
 `require' from /Users/ ************* /.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require’  
from  
/Users//.rvm/gems/ruby-2.1.2@myapp/gems/railties-4.1.4/lib/rails/cli.rb:14:in  
 `<top (required)>' from /Users/ ************* /.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require’  
from  
/Users/\*/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core\_ext/kernel\_require.rb:73:in  
 `require' from /Users/ ************* /.rvm/gems/ruby-2.1.2@myapp/gems/railties-4.1.4/bin/rails:9:in `\<top (required)\>’  
from /Users//.rvm/gems/ruby-2.1.2@myapp/bin/rails:23:in  
 `load' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/bin/rails:23:in `’  
from  
/Users/**_\*\*/.rvm/gems/ruby-2.1.2@myapp/bin/ruby\_executable\_hooks:15:in  
`eval' from /Users/ *********** /.rvm/gems/ruby-2.1.2@myapp/bin/ruby_executable_hooks:15:in `’  
:myapp \*\*\*\*\*\*\*\*\*\*\*$ An error occurred while installing mysql2 (0.3.16),  
and Bundler cannot continue.  
-bash: syntax error near unexpected token `(' :myapp *********** $ rails new . -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb Could not find gem 'quiet_assets (>= 0) ruby' in the gems available on this machine. Run `bundle install` to install missing gems.  
:myapp \*\*\*\*\*\*\*\*\*\*\*$ bundle install  
Fetching gem metadata from [https://rubygems.org/](https://rubygems.org/)…  
Fetching additional metadata from [https://rubygems.org/](https://rubygems.org/)…  
Resolving dependencies…  
Using rake 10.3.2  
Using i18n 0.6.11  
Using json 1.8.1  
Using minitest 5.4.0  
Using thread\_safe 0.3.4  
Using tzinfo 1.2.1  
Using activesupport 4.1.4  
Using builder 3.2.2  
Using erubis 2.7.0  
Using actionview 4.1.4  
Using rack 1.5.2  
Using rack-test 0.6.2  
Using actionpack 4.1.4  
Using mime-types 1.25.1  
Using polyglot 0.3.5  
Using treetop 1.4.15  
Using mail 2.5.4  
Using actionmailer 4.1.4  
Using activemodel 4.1.4  
Using arel 5.0.1.20140414130214  
Using activerecord 4.1.4  
Using addressable 2.3.6  
Using bcrypt 3.1.7  
Using coderay 1.1.0  
Using better\_errors 1.1.0  
Using debug\_inspector 0.0.2  
Using binding\_of\_caller 0.7.2  
Using sass 3.2.19  
Using bootstrap-sass 3.2.0.1  
Using bundler 1.6.2  
Using colorize 0.7.3  
Using net-ssh 2.9.1  
Using net-scp 1.2.1  
Using sshkit 1.5.1  
Using capistrano 3.0.1  
Using capistrano-bundler 1.1.2  
Using capistrano-rails 1.1.0  
Using capistrano-rails-console 0.2.0  
Using capistrano-rvm 0.1.1  
Using mini\_portile 0.6.0  
Using nokogiri 1.6.3.1  
Using xpath 2.0.0  
Using capybara 2.4.1  
Using timers 1.1.0  
Using celluloid 0.15.2  
Using ffi 1.9.3  
Using childprocess 0.5.3  
Using coffee-script-source 1.7.1  
Using execjs 2.2.1  
Using coffee-script 2.3.0  
Using thor 0.19.1  
Using railties 4.1.4  
Using coffee-rails 4.0.1  
Using database\_cleaner 1.3.0  
Using orm\_adapter 0.5.0  
Using warden 1.2.3  
Using devise 3.2.4  
Using diff-lcs 1.2.5  
Using factory\_girl 4.4.0  
Using factory\_girl\_rails 4.4.1  
Using faker 1.4.2  
Using hike 1.2.3  
Using multi\_json 1.10.1  
Using tilt 1.4.1  
Using sprockets 2.11.0  
Using sprockets-rails 2.1.3  
Using rails 4.1.4  
Using figaro 1.0.0.rc1  
Using formatador 0.2.5  
Using rb-fsevent 0.9.4  
Using rb-inotify 0.9.5  
Using listen 2.7.9  
Using lumberjack 1.0.9  
Using method\_source 0.8.2  
Using slop 3.6.0  
Using pry 0.10.0  
Using guard 2.6.1  
Using guard-bundler 2.0.0  
Using guard-rails 0.5.3  
Using rspec-support 3.0.3  
Using rspec-core 3.0.3  
Using rspec-expectations 3.0.3  
Using rspec-mocks 3.0.3  
Using rspec 3.0.0  
Using guard-rspec 4.3.1  
Using haml 4.1.0.beta.1  
Using sexp\_processor 4.4.3  
Using ruby\_parser 3.1.3  
Using haml2slim 0.4.7  
Using high\_voltage 2.2.1  
Using hpricot 0.8.6  
Using html2haml 1.0.1  
Using hub 1.12.2  
Using interception 0.5  
Using jbuilder 2.1.3  
Using jquery-rails 3.1.1  
Using launchy 2.4.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

```
/Users/ ************* /.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb

```

checking for ruby/thread.h… yes  
checking for rb\_thread\_call\_without\_gvl() in ruby/thread.h… yes  
checking for rb\_thread\_blocking\_region()… yes  
checking for rb\_wait\_for\_single\_fd()… yes  
checking for rb\_hash\_dup()… yes  
checking for rb\_intern3()… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lnsl… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lmygcc… no  
checking for mysql\_query() in -lmysqlclient… 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=/Users/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/.rvm/rubies/ruby-2.1.2/bin/ruby  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysql-config  
–without-mysql-config  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mlib  
–without-mlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-zlib  
–without-zlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-socketlib  
–without-socketlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-nsllib  
–without-nsllib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mygcclib  
–without-mygcclib  
–with-mysqlclientlib  
–without-mysqlclientlib

extconf failed, exit code 1

Gem files will remain installed in  
/Users/_**/.rvm/gems/ruby-2.1.2@myapp/gems/mysql2-0.3.16 for  
inspection.  
Results logged to  
/Users/**_/.rvm/gems/ruby-2.1.2@myapp/extensions/x86\_64-darwin-13/2.1.0-static/mysql2-0.3.16/gem\_make.out  
An error occurred while installing mysql2 (0.3.16), and Bundler cannot  
continue.  
Make sure that `gem install mysql2 -v '0.3.16'` succeeds before  
bundling.  
:myapp \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$ gem install mysql2 -v ‘0.3.16’  
Building native extensions. This could take a while…  
ERROR: Error installing mysql2:  
ERROR: Failed to build gem native extension.

```
/Users/ ************ /.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb

```

checking for ruby/thread.h… yes  
checking for rb\_thread\_call\_without\_gvl() in ruby/thread.h… yes  
checking for rb\_thread\_blocking\_region()… yes  
checking for rb\_wait\_for\_single\_fd()… yes  
checking for rb\_hash\_dup()… yes  
checking for rb\_intern3()… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lnsl… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lmygcc… no  
checking for mysql\_query() in -lmysqlclient… 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=/Users/\*\*\*\*\*\*\*\*\*\*\*\*\*\*/.rvm/rubies/ruby-2.1.2/bin/ruby  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysql-config  
–without-mysql-config  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mlib  
–without-mlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-zlib  
–without-zlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-socketlib  
–without-socketlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-nsllib  
–without-nsllib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mygcclib  
–without-mygcclib  
–with-mysqlclientlib  
–without-mysqlclientlib

extconf failed, exit code 1

Gem files will remain installed in  
/Users/\*\*\*\*\*\*\*\*\*\*\*/.rvm/gems/ruby-2.1.2@myapp/gems/mysql2-0.3.16 for  
inspection.  
Results logged to  
/Users/\*\*\*\*\*\*\*\*\*\*\*\*\*/.rvm/gems/ruby-2.1.2@myapp/extensions/x86\_64-darwin-13/2.1.0-static/mysql2-0.3.16/gem\_make.out

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 6, 2014, 9:02am UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394/2 "2014-08-06T09:02:55Z")

</div>

On 5 August 2014 23:53, Michael S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When I try to run bundle install, it gives me this error:
> 
> An error occurred while installing mysql2 (0.3.16), and Bundler cannot  
> continue.  
> Make sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.
> 
> When I run that command, I get:
> 
> ERROR: Error installing mysql2:  
> ERROR: Failed to build gem native extension.

You probably have not installed everything that is necessary for  
building gem native extensions. What you need depends on which OS you  
are using. For example, on Ubuntu, I do

sudo apt-get install build-essential bison openssl libreadline6  
libreadline6-dev curl git-core   
zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev autoconf  
libc6-dev ncurses-dev automake   
libtool

Colin

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 6, 2014, 7:19pm UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394/3 "2014-08-06T19:19:40Z")

</div>

I’m pretty sure I installed everything required. What could be missing  
on  
Mac OS X?

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 6, 2014, 7:21pm UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394/4 "2014-08-06T19:21:27Z")

</div>

OSX doesn’t have apt-get. You should use brew  
instead,[python - Why is the apt-get function not working in the terminal on Mac OS X v10.9 (Mavericks)? - Stack Overflow](http://stackoverflow.com/questions/19688424/why-is-apt-get-function-not-working-in-terminal-on-mac-osx-10-9),  
but  
this can occasionally have different installation instructions. Make  
sure  
you are installing MySQL correctly for Mac.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [August 7, 2014, 9:26am UTC](https://www.ruby-forum.com/t/error-after-calling-bundle-install-ruby-on-rails-installation-mac-os-x/231394/5 "2014-08-07T09:26:46Z")

</div>

On Wednesday, August 6, 2014 12:53:56 AM UTC+2, Michael S. wrote:

> sudo apt-get install mysql-server
> 
> checking for main() in -lz… yes  
> –with-opt-dir  
> –with-mysql-dir  
> –without-mysql-include=${mysql-dir}/include  
> –with-mysqlclientlib  
> –without-mygcclib  
> –with-mysqlclientlib  
> –without-mysqlclientlib
> 
> extconf failed, exit code 1  
> Gem files will remain installed in  
> /Users/**/.rvm/gems/ruby-2.1.2@myapp/gems/mysql2-0.3.16 for  
> inspection.Results logged to  
> /Users/**\*\*/.rvm/gems/ruby-2.1.2@myapp/extensions/x86\_64-darwin-13/2.1.0-static/mysql2-0.3.16/gem\_make.outAn  
> error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.Make  
> sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.  
> composer Updating gem paths.  
> WARN: Unresolved\<span
> 
> …

You can’t install mysql2 gem (used for MySQL database) without installin  
MySQL database server.  
To install it on OS X follow the steps as described here:

[http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial/](http://benjsicam.me/blog/how-to-install-mysql-on-mac-os-x-using-homebrew-tutorial/)

- Check the MySQL installation is OK.

- Run  
bundle install

- navigate to your RoR project in the terminal and run  
rails s
