Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble with mysql gem on osx 10.6.8
    primarykey
    data
    text
    <p>I'm updating my database from sqlite to mySQL (@<a href="https://stackoverflow.com/users/479863/mu-is-too-short">mu is too short</a>...I know. I know. I should have done it at the beginning) and running into a problem. </p> <p>Here's the process so far:</p> <h1>Step 1:</h1> <p>update database.yml and run rake db:schema:load as per <a href="https://stackoverflow.com/a/1670889/2128691">this</a></p> <pre><code>rake aborted! Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) </code></pre> <h1>Step 2:</h1> <p>run <code>rvm @global do gem install mysql</code></p> <pre><code>Fetching: mysql-2.9.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 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 --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/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --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}/ --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 Gem files will remain installed in /Users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1 for inspection. Results logged to /Users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1/ext/mysql_api/gem_make.out </code></pre> <h1>Step 3:</h1> <p>Search SO => <a href="https://stackoverflow.com/questions/17299158/cant-install-mysql-gem-on-mac-os-x">Can&#39;t install mysql gem on Mac OS X</a></p> <p>The solution in this answer didn't work as there is no <code>mySQL</code> directory in <code>/usr/local</code> so I can't edit the code there.</p> <h1>Step 4:</h1> <p>output of <code>mkmf.log</code> => <a href="http://pastebin.com/7qSdv73R" rel="nofollow noreferrer">http://pastebin.com/7qSdv73R</a><br> output of <code>gcc -v</code> => </p> <pre><code>Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5666) (dot 3) </code></pre> <h1>Edit 1:</h1> <p>I also ran: gem install activerecord-mysql-adapter</p> <p>which returned:</p> <pre><code>Fetching: mysql-2.9.1.gem (100%) Building native extensions. This could take a while... Successfully installed mysql-2.9.1 Fetching: i18n-0.6.5.gem (100%) Successfully installed i18n-0.6.5 Fetching: atomic-1.1.13.gem (100%) Building native extensions. This could take a while... Successfully installed atomic-1.1.13 Fetching: thread_safe-0.1.2.gem (100%) Successfully installed thread_safe-0.1.2 Fetching: activesupport-4.0.0.gem (100%) Successfully installed activesupport-4.0.0 Fetching: activerecord-mysql-adapter-0.0.1.gem (100%) Successfully installed activerecord-mysql-adapter-0.0.1 Fetching: builder-3.1.4.gem (100%) Successfully installed builder-3.1.4 Fetching: activemodel-4.0.0.gem (100%) Successfully installed activemodel-4.0.0 Fetching: arel-4.0.0.gem (100%) Successfully installed arel-4.0.0 Fetching: activerecord-deprecated_finders-1.0.3.gem (100%) Successfully installed activerecord-deprecated_finders-1.0.3 Parsing documentation for mysql-2.9.1 unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/mysql/mysql_api.bundle, skipping Installing ri documentation for mysql-2.9.1 Parsing documentation for i18n-0.6.5 Installing ri documentation for i18n-0.6.5 Parsing documentation for atomic-1.1.13 unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/atomic_reference.bundle, skipping Installing ri documentation for atomic-1.1.13 Parsing documentation for thread_safe-0.1.2 Installing ri documentation for thread_safe-0.1.2 Parsing documentation for activesupport-4.0.0 unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping Installing ri documentation for activesupport-4.0.0 Parsing documentation for activerecord-mysql-adapter-0.0.1 Installing ri documentation for activerecord-mysql-adapter-0.0.1 Parsing documentation for builder-3.1.4 /Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding : ignored /Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding ignored Installing ri documentation for builder-3.1.4 Parsing documentation for activemodel-4.0.0 Installing ri documentation for activemodel-4.0.0 Parsing documentation for arel-4.0.0 Installing ri documentation for arel-4.0.0 Parsing documentation for activerecord-deprecated_finders-1.0.3 Installing ri documentation for activerecord-deprecated_finders-1.0.3 10 gems installed </code></pre> <p>but I still get the same error when running <code>rake db:schema:load</code>: </p> <pre><code>Rake aborted! Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) ... </code></pre> <h1>Edit 2:</h1> <p>Here is <code>database.yml</code>:</p> <pre><code>development: adapter: mysql encoding: utf8 reconnect: false database: db/development pool: 5 username: [name] password: [password] socket: /tmp/mysql.sock test: adapter: mysql encoding: utf8 reconnect: false database: db/test pool: 5 username: [name] password: [password] socket: /tmp/mysql.sock production: adapter: mysql encoding: utf8 reconnect: false database: db/production pool: 5 username: [name] password: [password] socket: /tmp/mysql.sock </code></pre> <p>I added <code>gem "mysql"</code> to the <code>gemfile</code> and now am getting error</p> <pre><code>rake aborted! Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) </code></pre> <p>I don't know what those sockets should be, I filled them in based on a SO post, so that could be part of the problem. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload