title: Rails 3.1 and mysql [Fatal] failed to allocate memory
body: <p>I'm running a ruby on rails app</p>
  
  <p>Rails 3.1.3
  ruby 1.9.3p0</p>
  
  <p>I'm trying to get my database running and I get an FATAL error when I run rake db:migrate</p>
  
  <pre><code>rake db:migrate --trace
  ** Invoke db:migrate (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  [FATAL] failed to allocate memory
  </code></pre>
  
  <p>And I also get it when I run rails s</p>
  
  <pre><code>rails s
  =&gt; Booting WEBrick
  =&gt; Rails 3.1.3 application starting in development on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  [FATAL] failed to allocate memory
  </code></pre>
  
  <p>With a --trace I get this</p>
  
  <pre><code>rails s --trace
  /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:33:in `parse!': invalid option: --trace (OptionParser::InvalidOption)
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/server.rb:280:in `parse_options'
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/server.rb:180:in `options'
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:54:in `set_environment'
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:42:in `initialize'
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `new'
      from /Users/developer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `&lt;top (required)&gt;'
      from script/rails:6:in `require'
      from script/rails:6:in `&lt;main&gt;'
  </code></pre>
  
  <p>Any Clue whats join on? I've done a few searches, and <a href="https://stackoverflow.com/questions/7056157/mac-osx-lion-and-ruby-fatal-failed-to-allocate-memory">this looks to be the closest</a> but following their method of switching mysql didn't help.</p>