<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Rails 3.1.2 db Migration problem Rake aborted!]]></title>
		<link>http://railsforum.com/viewtopic.php?id=47899</link>
		<description><![CDATA[The most recent posts in Rails 3.1.2 db Migration problem Rake aborted!.]]></description>
		<lastBuildDate>Wed, 15 Feb 2012 11:49:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149753#p149753</link>
			<description><![CDATA[<p>There are some serious compatibility issues using Windows Server 2008+ Rails 3.1.3+ Ruby 1.9.2+mysql2+MySql Server 5.1.<br />I changed from mysql2 to sqlite3 and all works fine.<br />Thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Wed, 15 Feb 2012 11:49:28 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149753#p149753</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149713#p149713</link>
			<description><![CDATA[<p>Ouch, deployed on Windows,&nbsp; that&#039;s rough.</p><p>I&#039;m afraid I&#039;m out of ideas!</p>]]></description>
			<author><![CDATA[dummy@example.com (BradHodges)]]></author>
			<pubDate>Tue, 14 Feb 2012 16:37:29 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149713#p149713</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149710#p149710</link>
			<description><![CDATA[<p>My error log when executing rake db:migrate --trace : </p><br /><p>** Invoke db:migrate (first_time)<br />** Invoke environment (first_time)<br />** Execute environment<br />** Invoke db:load_config (first_time)<br />** Invoke rails_env (first_time)<br />** Execute rails_env<br />** Execute db:load_config<br />** Execute db:migrate<br />==&nbsp; Users: migrating =========================================================<br />==&nbsp; Users: migrated (0.0000s) ================================================</p><p>rake aborted!<br />An error has occurred, all later migrations canceled:</p><p>undefined method `rows&#039; for nil:NilClass<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act<br />ive_support/whiny_nil.rb:48:in `method_missing&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/connection_adapters/abstract/database_statements.rb:410:in `last_inser<br />ted_id&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/connection_adapters/abstract/database_statements.rb:91:in `insert&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/connection_adapters/abstract/query_cache.rb:14:in `insert&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:727:in `record_version_state_after_migrating&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:688:in `block (2 levels) in migrate&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:744:in `call&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:744:in `ddl_transaction&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:686:in `block in migrate&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:671:in `each&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:671:in `migrate&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:549:in `up&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/migration.rb:530:in `migrate&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/acti<br />ve_record/railties/databases.rake:161:in `block (2 levels) in &lt;top (required)&gt;&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:205:in `call&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:205:in `block in execute&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:200:in `each&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:200:in `execute&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:158:in `block in invoke_with_call_chain&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:151:in `invoke_with_call_chain&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.<br />rb:144:in `invoke&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:116:in `invoke_task&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:94:in `block (2 levels) in top_level&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:94:in `each&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:94:in `block in top_level&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:133:in `standard_exception_handling&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:88:in `top_level&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:66:in `block in run&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:133:in `standard_exception_handling&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli<br />cation.rb:63:in `run&#039;<br />C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in<br /> `&lt;top (required)&gt;&#039;<br />C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load&#039;<br />C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `&lt;main&gt;&#039;<br />Tasks: TOP =&gt; db:migrate</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Tue, 14 Feb 2012 15:46:42 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149710#p149710</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149699#p149699</link>
			<description><![CDATA[<p>You see the exact same problems faced by others also.</p><p>I checked the links as--</p><p><a href="https://github.com/screenconcept/kuhsaft/issues/8">https://github.com/screenconcept/kuhsaft/issues/8</a></p><p><a href="http://benstack.wordpress.com/2012/01/20/undefined-method-rows-for-nilnilclass/">http://benstack.wordpress.com/2012/01/2 &#133; lnilclass/</a></p><p>The solution doesn&#039;t resolved my problem either.</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Tue, 14 Feb 2012 12:23:57 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149699#p149699</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149698#p149698</link>
			<description><![CDATA[<p>That didn&#039;t resolved my problem.<br />The project was working fine in ubuntu development environment.<br />But this is Windows Production environment as I am hosting the application to goDaddy Server which is on Windows.<br />I checked my production.log and it just prints &quot;Migrating to CreateUsers (20120131131022)&quot;</p><p>I assume that gemfile is having some gems that are not compatible to Windows. Here in this case, its mysql2.</p><p>Although I believe migration files are not the issues, here is my migration file...</p><p>My migration file for users is-</p><p>class CreateUsers &lt; ActiveRecord::Migration<br />&nbsp; def self.up<br />&nbsp; &nbsp; create_table :users do |t|<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :login,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:null =&gt; false<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :email,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:null =&gt; false<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :crypted_password,&nbsp; &nbsp; :null =&gt; false<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :password_salt,&nbsp; &nbsp; &nbsp; &nbsp;:null =&gt; false<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :persistence_token,&nbsp; &nbsp;:null =&gt; false<br />&nbsp; &nbsp; &nbsp; #t.string&nbsp; &nbsp; :single_access_token, :null =&gt; false&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # optional, see Authlogic::Session::Params<br />&nbsp; &nbsp; &nbsp; #t.string&nbsp; &nbsp; :perishable_token,&nbsp; &nbsp; :null =&gt; false&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # optional, see Authlogic::Session::Perishability</p><p>&nbsp; &nbsp; &nbsp; # magic fields (all optional, see Authlogic::Session::MagicColumns)<br />&nbsp; &nbsp; &nbsp; t.integer&nbsp; &nbsp;:login_count,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:null =&gt; false, :default =&gt; 0<br />&nbsp; &nbsp; &nbsp; t.integer&nbsp; &nbsp;:failed_login_count,&nbsp; :null =&gt; false, :default =&gt; 0<br />&nbsp; &nbsp; &nbsp; t.datetime&nbsp; :last_request_at<br />&nbsp; &nbsp; &nbsp; t.datetime&nbsp; :current_login_at<br />&nbsp; &nbsp; &nbsp; t.datetime&nbsp; :last_login_at<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :current_login_ip<br />&nbsp; &nbsp; &nbsp; t.string&nbsp; &nbsp; :last_login_ip<br />&nbsp; &nbsp; &nbsp; t.timestamps<br />&nbsp; &nbsp; end</p><p>&nbsp; &nbsp; add_index :users, [&quot;login&quot;], :name =&gt; &quot;index_users_on_login&quot;, :unique =&gt; true<br />&nbsp; &nbsp; add_index :users, [&quot;email&quot;], :name =&gt; &quot;index_users_on_email&quot;, :unique =&gt; true<br />&nbsp; &nbsp; add_index :users, [&quot;persistence_token&quot;], :name =&gt; &quot;index_users_on_persistence_token&quot;, :unique =&gt; true</p><p>&nbsp; end</p><p>&nbsp; def self.down<br />&nbsp; &nbsp; drop_table :users<br />&nbsp; end<br />end</p><p>My migration file for add rolename to user is:---</p><p>class AddRoleNameToUser &lt; ActiveRecord::Migration<br />&nbsp; def change<br />&nbsp; &nbsp; add_column :users, :role_name, :string, :after =&gt; &#039;email&#039;<br />&nbsp; end<br />end</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Tue, 14 Feb 2012 12:17:00 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149698#p149698</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149632#p149632</link>
			<description><![CDATA[<p><a href="http://stackoverflow.com/questions/6460234/undifined-method-rows-for-nillclass-when-migrating-my-database-using-mysql2-gem">http://stackoverflow.com/questions/6460 &#133; mysql2-gem</a></p><p>I think this will solve your problem</p><p>BTW,&nbsp; simple trick always google the exact error message, leaving off specific like line numbers in your code, etc.</p>]]></description>
			<author><![CDATA[dummy@example.com (BradHodges)]]></author>
			<pubDate>Mon, 13 Feb 2012 18:00:07 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149632#p149632</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149629#p149629</link>
			<description><![CDATA[<p>Post the actual migration file you are running.</p><p>also post any SQL statements that show up in the development.log just prior to it blowing up.</p>]]></description>
			<author><![CDATA[dummy@example.com (BradHodges)]]></author>
			<pubDate>Mon, 13 Feb 2012 17:54:20 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149629#p149629</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149626#p149626</link>
			<description><![CDATA[<p>Yes, Database setup is fine.</p><p>Every When I do rake db:create, it creates the database also. </p><p>But Every time i do rake db:migrate i get an error saying &quot;undefined method &quot;rows&quot; for nill:Class&quot;. I am using the mysql2 gem&nbsp; on my windows machine and have installed mysql server 5.1.&nbsp; </p><p>It only creates the database and creates the first table but when it wants to finish the migration of the first table i get the error. </p><p>For your information, My database.yml file is-</p><p># MySQL.&nbsp; Versions 4.1 and 5.0 are recommended.<br />#<br /># Install the MySQL driver:<br />#&nbsp; &nbsp;gem install mysql2<br />#<br /># And be sure to use new-style password hashing:<br />#&nbsp; &nbsp;<a href="http://dev.mysql.com/doc/refman/5.0/en/old-client.html">http://dev.mysql.com/doc/refman/5.0/en/old-client.html</a><br />development:<br />&nbsp; adapter: mysql2<br />&nbsp; encoding: utf8<br />&nbsp; reconnect: false<br />&nbsp; database: zynapp_dev<br />&nbsp; pool: 5<br />&nbsp; username: root<br />&nbsp; password: rootroot<br />&nbsp; socket: /var/run/mysqld/mysqld.sock</p><p># Warning: The database defined as &quot;test&quot; will be erased and<br /># re-generated from your development database when you run &quot;rake&quot;.<br /># Do not set this db to the same as development or production.<br />test:<br />&nbsp; adapter: mysql2<br />&nbsp; encoding: utf8<br />&nbsp; reconnect: false<br />&nbsp; database: zynapp_test<br />&nbsp; pool: 5<br />&nbsp; username: root<br />&nbsp; password: rootroot<br />&nbsp; socket: /var/run/mysqld/mysqld.sock</p><p>production:<br />&nbsp; adapter: mysql2<br />&nbsp; encoding: utf8<br />&nbsp; reconnect: false<br />&nbsp; database: zynapp_prod<br />&nbsp; pool: 5<br />&nbsp; username: root<br />&nbsp; password: rootroot<br />&nbsp; socket: /var/run/mysqld/mysqld.sock</p><p> Any help?</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Mon, 13 Feb 2012 17:08:36 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149626#p149626</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149625#p149625</link>
			<description><![CDATA[<p>Is the database set up?</p><p>look in the development.log,&nbsp; see if any SQL was sent to the database.</p><p>My guess is that whatever database you&#039;ve specified in database.yml doesn&#039;t exist in your MySQL database.</p>]]></description>
			<author><![CDATA[dummy@example.com (BradHodges)]]></author>
			<pubDate>Mon, 13 Feb 2012 16:38:07 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149625#p149625</guid>
		</item>
		<item>
			<title><![CDATA[Rails 3.1.2 db Migration problem Rake aborted!]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149623#p149623</link>
			<description><![CDATA[<p>Hi,</p><p>I have been working with Ruby 1.8.7 with rails 2.3.8 and mysql since last 6<br />months.<br />I have just started working with rails &#039;3.1.2&#039; with Ruby 1.9.2<br />and mysql2.<br />Just to get hands-on with the new version of rails, I tried creating a<br />sample application with single scaffold (User username:string<br />password:string), but it gives the following error on db:migrate :-</p><p>==&nbsp; CreateUsers: migrating<br />====================================================<br />-- create_table(:users)<br />rake aborted!<br />An error has occurred, all later migrations canceled:</p><p>undefined method `rows&#039; for nil:NilClass</p><p>Tasks: TOP =&gt; db:migrate<br />(See full trace by running task with --trace)<br />&nbsp; &nbsp;-&gt; 0.1100s<br />==&nbsp; CreateUsers: migrated (0.1100s)<br />===========================================</p><br /><p>Any suggestions??</p>]]></description>
			<author><![CDATA[dummy@example.com (saurabhfaber)]]></author>
			<pubDate>Mon, 13 Feb 2012 16:30:56 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149623#p149623</guid>
		</item>
	</channel>
</rss>
