Rails 3.1和mysql [Fatal]无法分配内存

时间:2011-12-09 06:29:12

标签: mysql ruby-on-rails-3.1

我在rails app上运行ruby

Rails 3.1.3 红宝石1.9.3p0

我试图让我的数据库运行,当我运行rake db:migrate

时出现致命错误
rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
[FATAL] failed to allocate memory

当我运行rails s

时,我也会得到它
rails s
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[FATAL] failed to allocate memory

使用--trace我得到了这个

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 `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

任何线索什么加入?我已完成了一些搜索,this looks to be the closest但是按照他们切换mysql的方法没有帮助。

1 个答案:

答案 0 :(得分:-1)

我的猜测是你需要移除“厨房水槽”。减少宝石列表,使其仅适用于应用程序正常运行所需的内容。否则考虑添加更多内存。