Problema com atualização do OSX Leopard

4 views
Skip to first unread message

Leandro Rodrigues Jácome

unread,
Dec 20, 2009, 10:29:47 PM12/20/09
to rails-br
Salve, grandes usuários de rails, sou meio iniciante em rails e estou
tendo um problema recentemente com migração sistema operacional OS X
Leoparde para Snow quando instalei o mysql-x85_64 da intel pc que é
recomendado depois de configurar o bd com user e senha root, porem não
consigo fazer a gem funcionar como era tradicionalmente antes do
upgrade com o mysql x86_32 vamos passo a passo.

com mysql instslado e configurado:
sudo env ARCHFLAGS='-arch x86_64' gem install --verbose --no-rdoc --no-
ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Resultado:
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://gems.rubyforge.org/quick/Marshal.4.8/mysql-2.8.1.gemspec.rz
Installing gem mysql-2.8.1
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/COPYING
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/COPYING.ja
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/History.txt
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/Manifest.txt
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/README.txt
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/Rakefile
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/extconf.rb
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/mysql.c
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/extra/README.html
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/extra/README_ja.html
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/extra/tommy.css
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql.rb
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/tasks/gem.rake
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/tasks/native.rake
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/tasks/vendor_mysql.rake
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/test/test_mysql.rb
Building native extensions. This could take a while...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... yes
checking for mysql.h... yes
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/
usr/lib/ruby/1.8/universal-darwin10.0 -I. -DHAVE_MYSQL_SSL_SET -
DHAVE_RB_STR_SET_LEN -DHAVE_RB_THREAD_START_TIMER -DHAVE_MYSQL_H -
D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/mysql/include -g -Os
-arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE
-DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -
DDONT_DECLARE_CXA_PURE_VIRTUAL -fno-common -arch x86_64 -g -Os -pipe -
fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c
mysql.c
mysql.c: In function ‘time_inspect’:
mysql.c:1791: warning: format ‘%04d’ expects type ‘int’, but argument
5 has type ‘long int’
mysql.c:1791: warning: format ‘%02d’ expects type ‘int’, but argument
6 has type ‘long int’
mysql.c:1791: warning: format ‘%02d’ expects type ‘int’, but argument
7 has type ‘long int’
mysql.c:1791: warning: format ‘%02d’ expects type ‘int’, but argument
8 has type ‘long int’
mysql.c:1791: warning: format ‘%02d’ expects type ‘int’, but argument
9 has type ‘long int’
mysql.c:1791: warning: format ‘%02d’ expects type ‘int’, but argument
10 has type ‘long int’
mysql.c: In function ‘time_to_s’:
mysql.c:1804: warning: format ‘%04d’ expects type ‘int’, but argument
5 has type ‘long int’
mysql.c:1804: warning: format ‘%02d’ expects type ‘int’, but argument
6 has type ‘long int’
mysql.c:1804: warning: format ‘%02d’ expects type ‘int’, but argument
7 has type ‘long int’
mysql.c:1804: warning: format ‘%02d’ expects type ‘int’, but argument
8 has type ‘long int’
mysql.c:1804: warning: format ‘%02d’ expects type ‘int’, but argument
9 has type ‘long int’
mysql.c:1804: warning: format ‘%02d’ expects type ‘int’, but argument
10 has type ‘long int’
cc -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o
mysql_api.bundle mysql.o -L. -L/System/Library/Frameworks/
Ruby.framework/Versions/1.8/usr/lib -L. -arch x86_64 -lruby -L/usr/
local/mysql/lib -lmysqlclient -lz -lm -lmygcc -lpthread -ldl

make install
/usr/bin/install -c -m 0755 mysql_api.bundle /Library/Ruby/Gems/1.8/
gems/mysql-2.8.1/lib
Successfully installed mysql-2.8.1
1 gem installed

E quando executo rake db:create

Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
"username"=>"root", "adapter"=>"mysql",
"database"=>"funcionarios_development", "host"=>"localhost",
"pool"=>5, "password"=>"root"}, charset: utf8, collation:
utf8_unicode_ci (if you set the charset manually, make sure you have a
matching collation)

e com o rake db:migrate
rake aborted!
Can't connect to local MySQL server through socket '/tmp/
mysql.sock' (2)

(See full trace by running task with --trace)

Mais o servidor tá on... será que alguem pode me ajudar...

Desculpe pelos erros de portugues mais ja tomei uns tequilas baby!
rsrs se ficou mau explicado amanha melhoro..

Rodolfo S. Carvalho

unread,
Dec 21, 2009, 4:28:35 AM12/21/09
to rail...@googlegroups.com
Olá, Leandro!

2009/12/21 Leandro Rodrigues Jácome <leandro...@gmail.com>
O seu problema é que o arquivo de socket do mysql não está em /tmp/mysql.sock. Tente localizar onde está o mysql.sock, ou então mude a seguinte linha no config/database.yml:

host: localhost

para

host: 127.0.0.1

E apague a linha onde há "socket: /tmp/mysql.sock". Desta forma voce vai conectar via TCP/IP ao servidor, e não via socket.
 
Desculpe pelos erros de portugues mais ja tomei uns tequilas baby!
rsrs se ficou mau explicado amanha melhoro..

--

Você está recebendo esta mensagem porque se inscreveu no grupo "rails-br" dos Grupos do Google.
Para postar neste grupo, envie um e-mail para rail...@googlegroups.com.
Para cancelar a inscrição nesse grupo, envie um e-mail para rails-br+u...@googlegroups.com.
Para obter mais opções, visite esse grupo em http://groups.google.com/group/rails-br?hl=pt-BR.





--
   Rodolfo Carvalho
    Web Developer
rodol...@gmail.com

Borga

unread,
Dec 21, 2009, 8:26:01 PM12/21/09
to rails-br
Só complementando a mensagem anterior, estou com o mesmo problema mas
as msgs de erro são diferentes, veja quando eu dou o comando
db:create:all e o db:migrate:

MacBorga:blog borga$ rake db:create:all --trace
(in /Users/borga/rails/blog)
** Invoke db:create:all (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create:all


Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",

"username"=>"root", "adapter"=>"mysql", "database"=>"blog_production",
"host"=>"localhost", "pool"=>5, "password"=>nil}, charset: utf8,


collation: utf8_unicode_ci (if you set the charset manually, make sure
you have a matching collation)

Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
"username"=>"root", "adapter"=>"mysql",

"database"=>"blog_development", "host"=>"localhost", "pool"=>5,
"password"=>nil}, charset: utf8, collation: utf8_unicode_ci (if you


set the charset manually, make sure you have a matching collation)

Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",

"username"=>"root", "adapter"=>"mysql", "database"=>"blog_test",
"host"=>"localhost", "pool"=>5, "password"=>nil}, charset: utf8,


collation: utf8_unicode_ci (if you set the charset manually, make sure
you have a matching collation)

MacBorga:blog borga$ rake db:migrate --trace
(in /Users/borga/rails/blog)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
uninitialized constant MysqlCompat::MysqlRes
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:440:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/mysql_adapter.rb:68:in `mysql_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:223:in `send'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:188:in `checkout'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:184:in `loop'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:184:in `checkout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:183:in `checkout'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:98:in `connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_specification.rb:115:in
`connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
migration.rb:435:in `initialize'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
migration.rb:400:in `new'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
migration.rb:400:in `up'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
migration.rb:383:in `migrate'
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:116
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Agradeço desde já se alguém me ajudar.

[]'s

Ricardo Borghetti (Borga)

On 21 dez, 07:28, "Rodolfo S. Carvalho" <rodolfo....@gmail.com> wrote:
> Olá, Leandro!
>

> 2009/12/21 Leandro Rodrigues Jácome <leandro.jac...@gmail.com>

> > rails-br+u...@googlegroups.com<rails-br%2Bunsu...@googlegroups.com>


> > .
> > Para obter mais opções, visite esse grupo em
> >http://groups.google.com/group/rails-br?hl=pt-BR.
>
> --
>    Rodolfo Carvalho
>     Web Developer

> rodolfo....@gmail.com

Jackson Pires

unread,
Dec 21, 2009, 8:30:19 PM12/21/09
to rail...@googlegroups.com
Tive esse mesmo problema, minha solução postei aqui >> http://jacksonpires.blogspot.com/2009/12/require-mysqlapi-error-no-rails-snow.html


vlw!






2009/12/21 Borga <guairan...@gmail.com>
Para cancelar a inscrição nesse grupo, envie um e-mail para rails-br+u...@googlegroups.com.

Para obter mais opções, visite esse grupo em http://groups.google.com/group/rails-br?hl=pt-BR.





--
"Não sejas sábio aos seus próprios olhos..."
==============================


Jackson Pires de O. S. Júnior
~~~~~~~~~~~~~~~~~~~
Paulo Afonso - BA
NETícias: http://jacksonpires.blogspot.com/
NordesTi: http://www.nordesti.com.br
Reply all
Reply to author
Forward
0 new messages