The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Brand new to this and reading right out of the Apress book. Things seem to go fine but my migration file is never created. Where do I begin to hunt this issue down? No table was created in my db either.

I'm just shooting in the dark, here, but I'd try "-ft" for the switches, which will clear out the "identical" messages, but I'd also check the output from "script/generate model" by itself to make sure that works and also "script/generate model TestThing name:string" just to see if they gave me more information.

There was a bug in the generators for Rails 2.1.2, but I don't recall it exhibiting this particular error message. Do you have control over the gems and the rails versions?

Recent versions of Rails require you to install the mysql gem. In older versions of Rails, MySQL support was installed by default. Most Rails books were written before this change so don't include the requirement to install the mysql gem. Try doing a:

gem install mysql

However, note that if you are running on XP, there can be problems with this gem and certain versions of MySQL. See this thread:

Trying to install the mysql gem I encounter what I believe is the same error.

Code:

/usr/local/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-freebsd6.1 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_MYSQL_H -I/usr/local/include -fPIC -O2 -g -Wall -Wno-parentheses -omysql.o -c mysql.c
mysql.c:6:21: version.h: No such file or directory
mysql.c: In function `make_field_obj':
mysql.c:185: warning: unused variable `hash'
mysql.c: In function `escape_string':
mysql.c:267: error: structure has no member named `len'
mysql.c:268: error: structure has no member named `len'
mysql.c:268: error: structure has no member named `ptr'
mysql.c:268: error: structure has no member named `ptr'
mysql.c:268: error: structure has no member named `len'
mysql.c: In function `real_escape_string':
mysql.c:401: error: structure has no member named `len'
mysql.c:402: error: structure has no member named `len'
mysql.c:402: error: structure has no member named `ptr'
mysql.c:402: error: structure has no member named `ptr'
mysql.c:402: error: structure has no member named `len'
mysql.c: In function `query':
mysql.c:710: error: structure has no member named `ptr'
mysql.c:710: error: structure has no member named `len'
mysql.c:729: error: structure has no member named `ptr'
mysql.c:729: error: structure has no member named `len'
mysql.c: In function `query_with_result_set':
mysql.c:882: warning: implicit declaration of function `TypeError'
mysql.c: In function `fetch_field_direct':
mysql.c:960: warning: implicit declaration of function `Raise'
mysql.c: In function `fetch_hash2':
mysql.c:1032: error: structure has no member named `ptr'
mysql.c:1033: error: structure has no member named `ptr'
mysql.c: In function `field_inspect':
mysql.c:1157: error: structure has no member named `len'
mysql.c:1158: error: structure has no member named `ptr'
mysql.c:1158: error: structure has no member named `ptr'
mysql.c: In function `stmt_bind_result':
mysql.c:1284: error: structure has no member named `ptr'
mysql.c: In function `stmt_execute':
mysql.c:1346: error: structure has no member named `ptr'
mysql.c:1347: error: structure has no member named `len'
mysql.c:1348: error: structure has no member named `len'
mysql.c:1359: error: structure has no member named `ptr'
mysql.c:1360: error: structure has no member named `ptr'
mysql.c:1361: error: structure has no member named `ptr'
mysql.c:1362: error: structure has no member named `ptr'
mysql.c:1363: error: structure has no member named `ptr'
mysql.c:1364: error: structure has no member named `ptr'
mysql.c:1316: warning: unused variable `false'
mysql.c: In function `stmt_prepare':
mysql.c:1584: error: structure has no member named `ptr'
mysql.c:1584: error: structure has no member named `len'
*** Error code 1
Stop in /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7.

I suppose the first issue is version.h hasn't been created. Even after I installed ruby again.