Migrate hangs on Mac OS X

Hello:

A plea for help. I’m following the instructions here:

http://developer.apple.com/tools/rubyonrails.html

I have everything working on my main machine, but my laptop is refusing
to work. When I get to the step of ‘rake migrate’ the process hangs. I
have the output below.

The mysql gem is installed, and a test program can talk to the database
fine.

The only difference that I can see between the machine that works, and
the machine that doesn’t is that the working one has mysql 4.1.5, and
the non-working one has 4.1.18 (current).

Stumped.

Anyone?

Bueller?

Thanks.

parki…

expenses: rake migrate -t
(in /Users/parki/develop/rails/expenses)
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
^Crake aborted!

/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in
read' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in read’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:499:in
read' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:492:in command’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:339:in
stat' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:147:in active?’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in
retrieve_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in
retrieve_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/migration.rb:178:in
migrate' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks/databases.rake:3 /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks/databases.rake:2:in call’
/usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:202:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:202:in each’
/usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:202:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:180:in invoke’
/usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:1454:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:1454:in each’
/usr/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake.rb:1454:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/bin/rake:7 /usr/bin/rake:18:in load’
/usr/bin/rake:18

Brian P. wrote:

Hello:

A plea for help. I’m following the instructions here:

http://developer.apple.com/tools/rubyonrails.html

I did a bit more digging - the migration stalls here in mysql.rb - it’s
waiting on the 4 bytes for length, which presumably never come back from
the server:

def read()
  buf = []
  len = nil
  @sock.sync = false
  while len == nil or len == MAX_PACKET_LENGTH do
a = @sock.read(4)     <------------------------------- HERE
len = a[0]+a[1]*256+a[2]*256*256
pkt_nr = a[3]
if @pkt_nr != pkt_nr then
  raise "Packets out of order: #{@pkt_nr}<>#{pkt_nr}"
end
@pkt_nr = @pkt_nr + 1 & 0xff
buf << @sock.read(len)
  end
  @sock.sync = true
  buf.join
rescue
  errno = Error::CR_SERVER_LOST
  raise Error::new(errno, Error::err(errno))
end

Fixed.

I don’t know what was causing this, but I re-installed MySql, and
everything is working perfectly.

Weird.

Happy!

parki…

Brian P. wrote:

Brian P. wrote:

Hello:

A plea for help. I’m following the instructions here:

http://developer.apple.com/tools/rubyonrails.html

I did a bit more digging - the migration stalls here in mysql.rb - it’s
waiting on the 4 bytes for length, which presumably never come back from
the server:

def read()
  buf = []
  len = nil
  @sock.sync = false
  while len == nil or len == MAX_PACKET_LENGTH do

a = @sock.read(4) <------------------------------- HERE
len = a[0]+a[1]*256+a[2]256256
pkt_nr = a[3]
if @pkt_nr != pkt_nr then
raise “Packets out of order: #{@pkt_nr}<>#{pkt_nr}”
end
@pkt_nr = @pkt_nr + 1 & 0xff
buf << @sock.read(len)
end
@sock.sync = true
buf.join
rescue
errno = Error::CR_SERVER_LOST
raise Error::new(errno, Error::err(errno))
end

Did you change your settings in the database.yml to correspond to your
MySQL
install?

That would be the next place I’d check to make sure that you have the
correct settings.

Ryan