# Gem fails to build mysql

**URL:** <https://www.ruby-forum.com/t/gem-fails-to-build-mysql/121121>\
**Category:** Rails\
**Created:** [November 24, 2007, 1:46am UTC](https://www.ruby-forum.com/t/gem-fails-to-build-mysql/121121 "2007-11-24T01:46:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![boo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7feea3/32.png) [@boo](https://www.ruby-forum.com/u/boo)\
**Post date:** [November 24, 2007, 1:46am UTC](https://www.ruby-forum.com/t/gem-fails-to-build-mysql/121121/1 "2007-11-24T01:46:52Z")

</div>

# gem install mysql --with-mysql-lib=/usr/local/mysql/lib

ERROR: While executing gem … (OptionParser::InvalidOption)  
invalid option: --with-mysql-lib=/usr/local/mysql/lib

---

<div class="post-metadata">

**Author:** ![boo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7feea3/32.png) [@boo](https://www.ruby-forum.com/u/boo)\
**Post date:** [November 24, 2007, 6:08am UTC](https://www.ruby-forum.com/t/gem-fails-to-build-mysql/121121/2 "2007-11-24T06:08:12Z")

</div>

try:  
gem install mysql – --with-mysql-lib=/usr/local/mysql/lib

notice the double --'s with a space in between

-Bill

---

<div class="post-metadata">

**Author:** ![boo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7feea3/32.png) [@boo](https://www.ruby-forum.com/u/boo)\
**Post date:** [November 24, 2007, 6:12am UTC](https://www.ruby-forum.com/t/gem-fails-to-build-mysql/121121/3 "2007-11-24T06:12:52Z")

</div>

I should have explained why as well. the first set of double dashes  
tells the gem command that any options following it are build options to  
be sent to the gem rather than options for the gem command itself. The  
command template looks like this:

gem install GEMNAME [options] – --build-flags [options]

-Bill
