<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>The Bacon Bear Blog: Setting up a fresh OSX rails install</title>
    <link>http://www.baconbear.com/articles/2006/12/24/setting-up-a-fresh-osx-rails-install</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Setting up a fresh OSX rails install</title>
      <description>&lt;p&gt;While setting up a fresh rails install on a basically virgin system, I stumbled across this &lt;a href="http://blog.duncandavidson.com/2006/04/sandboxing_rail.html"&gt;web site&lt;/a&gt; which goes over exactly that.  So, instead of having to figure this all out for myself (again) I could simply follow the instructions of another.&lt;/p&gt;

&lt;p&gt;All was not pain free however (why is the process never pain free?).  When trying to start mysql via launchctl, mysqld would not start.  In fact it didn&amp;#8217;t seem to do anything!  I could see the mysql.server start script being called but then it would just sit there.&lt;/p&gt;

&lt;p&gt;Since that route failed me, I then tried the more direct route of starting via /opt/local/lib/mysql5/bin/mysqld.  This seemed to start the server but it would then immediately stop.  Checking the logs, I found this:&lt;/p&gt;

&lt;pre&gt;
061224 23:09:52  mysqld started
061224 23:09:52 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
061224 23:09:52  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
061224 23:09:52  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
061224 23:09:52  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
061224 23:09:52  InnoDB: Started; log sequence number 0 43655
061224 23:09:52 [ERROR] /opt/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
061224 23:09:52 [ERROR] /opt/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
061224 23:09:52 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
061224 23:09:52  mysqld ended
&lt;/pre&gt;

&lt;p&gt;Looking up the mysql/host.frm complaint with google led me to this &lt;a href="http://www.linuxquestions.org/questions/showthread.php?t=262262"&gt;thread&lt;/a&gt; on linuxquestions.  Bullet point #5 of &amp;#8220;Butt-Ugly&amp;#8220;&amp;#8216;s response solved my problem.  Looks like perhaps darwinports or myself had created this database with the root user instead of the mysql user causing mysqld to have permissions problems when trying trying to read files it needed.&lt;/p&gt;

&lt;p&gt;Removing the files in that directory followed by a restart of the server fixed the problem and I was on my way to mysql bliss.&lt;/p&gt;</description>
      <pubDate>Sun, 24 Dec 2006 21:55:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:75b2efdb-62e3-45a8-bc0a-53e1d291d197</guid>
      <author>Jeff</author>
      <link>http://www.baconbear.com/articles/2006/12/24/setting-up-a-fresh-osx-rails-install</link>
      <category>rails</category>
    </item>
  </channel>
</rss>
