Mac mac 上 rails3 项目你用地时什么 gem 来联 mysql? mysql2 回报错说无法分配内存。

dexterdeng · 2012年01月18日 · 最后由 dexterdeng 回复于 2012年02月04日 · 3892 次阅读

mac 上 rails3 项目你用地时什么 gem 来联 mysql? mysql2 会报错说无法分配内存。

gem install mysql2 -V 再把结果贴出来

➜ wig git:(master) ✗ gem install mysql2 -V GET http://rubygems.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK Installing gem mysql2-0.3.11 /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/.gitignore /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/.rspec /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/.rvmrc /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/.travis.yml /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/CHANGELOG.md /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/Gemfile /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/MIT-LICENSE /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/README.md /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/Rakefile /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/active_record.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/active_record_threaded.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/allocations.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/escape.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/query_with_mysql_casting.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/query_without_mysql_casting.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/sequel.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/setup_db.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/benchmark/threaded.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/examples/eventmachine.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/examples/threaded.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/client.c /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/client.h /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/extconf.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/mysql2_ext.c /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/mysql2_ext.h /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/result.c /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/result.h /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/ext/mysql2/wait_for_single_fd.h /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/client.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/em.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/error.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/result.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/version.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/mysql2.gemspec /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/em/em_spec.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/mysql2/client_spec.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/mysql2/error_spec.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/mysql2/result_spec.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/rcov.opts /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/spec/spec_helper.rb /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/tasks/benchmarks.rake /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/tasks/compile.rake /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/tasks/rspec.rake /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/tasks/vendor_mysql.rake Building native extensions. This could take a while... /Users/mac/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... yes checking for mysql.h... yes checking for errmsg.h... yes checking for mysqld_error.h... yes creating Makefile

make compiling client.c client.c: In function ‘rb_raise_mysql2_error’: client.c:98: warning: ISO C90 forbids mixed declarations and code client.c: In function ‘rb_mysql_client_socket’: client.c:590: warning: ISO C90 forbids mixed declarations and code compiling mysql2_ext.c compiling result.c linking shared-object mysql2/mysql2.bundle

make install /usr/bin/install -c -m 0755 mysql2.bundle /Users/mac/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2 installing default mysql2 libraries Successfully installed mysql2-0.3.11 1 gem installed Installing ri documentation for mysql2-0.3.11... rdoc --ri --op /Users/mac/.rvm/gems/ruby-1.9.3-p0/doc/mysql2-0.3.11/ri --charset=UTF-8 lib --title mysql2-0.3.11 Documentation --quiet Installing RDoc documentation for mysql2-0.3.11... rdoc --op /Users/mac/.rvm/gems/ruby-1.9.3-p0/doc/mysql2-0.3.11/rdoc --charset=UTF-8 lib --title mysql2-0.3.11 Documentation --quiet

需要 登录 后方可回复, 如果你还没有账号请 注册新账号