Окружающая среда:
Mac OS X 10.6.4
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
$ rails -v
Rails 2.3.9
$ mysql --version
mysql Ver 14.14 Distrib 5.1.51, for apple-darwin10.3.0 (i386) using readline 5.1
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/ethan/.gem/ruby/1.8
- /Library/Ruby/Gems/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gemcutter.org"]
- REMOTE SOURCES:
- http://gemcutter.org
Установил MySQL, скачав mysql-5.1.51-osx10.6-x86.dmg
с mysql.com.
Установлен MySQL драгоценный камень, как это:
$ sudo gem install mysql --no-rdoc --no-ri -- \
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include
Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
$ gem list -l | grep mysql
mysql (2.8.1)
MySQL работает:
$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.51 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Проблема:
$ rake db:create
(in /Users/.../project/employeedata)
Couldn't create database for {"encoding"=>"utf8", "adapter"=>"mysql", "username"=>"root", "database"=>"employeedata_development", "password"=>nil, "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)
Вопрос:
Как мне заставить работать mysql gem?