Forum: Ruby on Rails Migrate hangs on Mac OS X

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
44262058c9f30942c2f1ffbf3b512142?d=identicon&s=25 Brian Parkinson (parki)
on 2006-03-19 00:18
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
44262058c9f30942c2f1ffbf3b512142?d=identicon&s=25 Brian Parkinson (parki)
on 2006-03-19 01:08
Brian Parkinson 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
44262058c9f30942c2f1ffbf3b512142?d=identicon&s=25 Brian Parkinson (parki)
on 2006-03-19 23:52
Fixed.

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

Weird.

Happy!

parki...



Brian Parkinson wrote:
> Brian Parkinson 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
Eed3ca2591560a2dd91222d9b62f882d?d=identicon&s=25 Ryan Prins (Guest)
on 2006-03-20 06:38
(Received via mailing list)
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
This topic is locked and can not be replied to.