HighDots Forums  

Learning ruby on Mac - rake create error

Ruby On Rails Talk Ruby On Rails programming language mailing list


Discuss Learning ruby on Mac - rake create error in the Ruby On Rails Talk forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kathy Koehler
 
Posts: n/a

Default Learning ruby on Mac - rake create error - 09-07-2009 , 09:10 AM






I can do a mysql -u root and then type in create database
restaurant_test, development, production but when I run

rake db:create:all I get:

(in
/Users/katherinekoehler/Documents/workspace/kkoehler/classes/ruby/lesson5/restaurant)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_development", "pool"=>5}, charset: utf8,
collation: utf8_general_ci (if you set the charset manually, make sure
you have a matching collation)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_production", "pool"=>5}, charset: utf8,
collation: utf8_general_ci (if you set the charset manually, make sure
you have a matching collation)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_test", "pool"=>5}, charset: utf8, collation:
utf8_general_ci (if you set the charset manually, make sure you have a
matching collation)


My .yml files:

development:
adapter: mysql
encoding: utf8
reconnect: false
database: restaurant_development
pool: 5
username: root
password:
host: localhost
socket: /tmp/mysql.sock


/tmp/mysql.sock exists

My mysql process:

74 195 173 0 32:13.26 ?? 109:41.08 /sw/sbin/mysqld --basedir=/sw
--datadir=/sw/var/mysql --user=mysql
--pid-file=/sw/var/mysql/katherine-koehlers-macbook-pro.local.pid -u
root



I also did a sudo gem update mysql-ruby to make sure I had the latest
libraries.

I've spent hours on this. Any ideas?

Kathy
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #2  
Old   
Rick
 
Posts: n/a

Default Re: Learning ruby on Mac - rake create error - 09-08-2009 , 08:56 PM






rake db:create:all works fine here:

/mystest 741 > mysql --version
mysql Ver 14.14 Distrib 5.1.31, for apple-darwin9.5.0 (powerpc) using
readline 5.1
/mystest 742 > gem list mysql

*** LOCAL GEMS ***

mysql (2.8.1)
/mystest 743 > cat config/database.yml
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql
# On Mac OS X:
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-
config=/usr/local/mysql/bin/mysql_config
# This sets the ARCHFLAGS environment variable to your native
architecture
# On Windows:
# gem install mysql
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
encoding: utf8
reconnect: false
database: mystest_development
pool: 5
username: root
password:
host: localhost

..
..
..

NOTE: the gem installs with: sudo gem install mysql

I can reproduce your error message if I hand in an incorrect username
or password so I'm guessing the utf8 and matching collation is
gibberish meant to confound the confusible;-()

On Sep 7, 9:10*am, Kathy Koehler <rails-mailing-l... (AT) andreas-s (DOT) net>
wrote:
Quote:
I can do a mysql -u root and then type in create database
restaurant_test, development, production but when I run

rake db:create:all I get:

(in
/Users/katherinekoehler/Documents/workspace/kkoehler/classes/ruby/lesson5/restaurant)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_development", "pool"=>5}, charset: utf8,
collation: utf8_general_ci (if you set the charset manually, make sure
you have a matching collation)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_production", "pool"=>5}, charset: utf8,
collation: utf8_general_ci (if you set the charset manually, make sure
you have a matching collation)
Couldn't create database for {"socket"=>"/tmp/mysql.sock",
"reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
"adapter"=>"mysql", "host"=>"localhost", "password"=>nil,
"database"=>"restaurant_test", "pool"=>5}, charset: utf8, collation:
utf8_general_ci (if you set the charset manually, make sure you have a
matching collation)

My .yml files:

development:
adapter: mysql
encoding: utf8
reconnect: false
database: restaurant_development
pool: 5
username: root
password:
host: localhost
socket: /tmp/mysql.sock

/tmp/mysql.sock exists

My mysql process:

74 195 173 0 32:13.26 ?? 109:41.08 /sw/sbin/mysqld --basedir=/sw
--datadir=/sw/var/mysql --user=mysql
--pid-file=/sw/var/mysql/katherine-koehlers-macbook-pro.local.pid -u
root

I also did a sudo gem update mysql-ruby to make sure I had the latest
libraries.

I've spent hours on this. *Any ideas?

Kathy
--
Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #3  
Old   
dan
 
Posts: n/a

Default Re: Learning ruby on Mac - rake create error - 11-07-2009 , 06:19 PM



i was using sqlite for the past few projects and getting things
running smoothly enough
recently getting macports, git, installing a git module; geokit
turns out geokit has more functionality in mysql / postgress then
sqlite, namely distancing functions

i create the project as mysql, scaffold a location model then try to
run db:create
but i fail on rake db:create command

<code>
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
"username"=>"***", "adapter"=>"mysql", "database"=>"v3_development_2",
"pool"=>5, "password"=>"***", "socket"=>"/tmp/mysql.sock"}, charset:
utf8, collation: utf8_general_ci (if you set the charset manually,
make sure you have a matching collation)
</code>

*** used for username and password

i can login to mysql with the username and password
s displays current character set latin1
i can change to utf8, run the command and get same error
if i restart mysql, it returns to latin1

is character set really the issue?
do i need directory user permissions to create the db from rails?

rails 2.3.3
ruby 1.8.7
mysql 5.1.39

<code>
mysql Ver 14.14 Distrib 5.1.39, for apple-darwin9.5.0 (i386) using
readline 5.1

Connection id: 438
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.39 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 14 min 32 sec
</code>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #4  
Old   
dan
 
Posts: n/a

Default Re: Learning ruby on Mac - rake create error - 11-08-2009 , 03:37 AM



so is this mysql default charset as latin1 really a problem?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #5  
Old   
Steve Wilhelm
 
Posts: n/a

Default Re: Learning ruby on Mac - rake create error - 11-13-2009 , 01:51 PM



I am having a similar problem. Did you find a solution?

On Nov 8, 12:37*am, dan <mr.dan.ma... (AT) gmail (DOT) com> wrote:
Quote:
so is this mysql default charset as latin1 really a problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #6  
Old   
Martin Streicher
 
Posts: n/a

Default Re: Learning ruby on Mac - rake create error - Today , 10:28 AM



I had this same issue with an older project but not with a new
project, so I copied the newer database.yml file to the older project,
renamed the database in the file, and then things worked. My new entry
looks like this:

development:
adapter: mysql
encoding: utf8
reconnect: false
database: dev
pool: 5
username: strike
password: secret

On Nov 13, 1:51*pm, Steve Wilhelm <st... (AT) studio831 (DOT) com> wrote:
Quote:
I am having a similar problem. *Did you find a solution?

On Nov 8, 12:37*am, dan <mr.dan.ma... (AT) gmail (DOT) com> wrote:



so is this mysql default charset as latin1 really a problem?
--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk (AT) googlegroups (DOT) com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.