Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7082035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:59:45+00:00 2026-05-28T06:59:45+00:00

Going through Lynda’s 2010 tutorial on rails and have been stuck on migration for

  • 0

Going through Lynda’s 2010 tutorial on rails and have been stuck on migration for the past couple of days. When running

$ rake db:migrate

I get

NOC-4:app noc$ rake db:migrate
(in /Users/noc/rails_projects/app)
== CreateUsers: migrating ====================================================
— create_table(:users)
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::ServerError::ParseError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1: CREATE TABLE users (id int(11) DEFAULT NULL auto_increment PRIMARY KEY, first_name varchar(25), last_name varchar(50), email varchar(255) DEFAULT ” NOT NULL, created_at datetime, updated_at datetime, password varchar(#)) ENGINE=InnoDB

(See full trace by running task with –trace)

=================================

NOC-4:app noc$ mysql –version

mysql Ver 14.14 Distrib 5.5.20, for osx10.6 (i386) using readline 5.1

Below is my migrate file (create_users.rb):

class CreateUsers < ActiveRecord::Migration
   def self.up
     create_table :users do |t|
       t.string "first_name", :limit => 25
       t.string "last_name", :limit => 50
       t.string "email", :default => "", :null => false
       t.string "password", :limit =>
       t.timestamps
     end
   end

   def self.down
     drop_table :users
   end
 end

========================================

My rails version and gem list below:

NOC-4:app noc$ rails --version
Rails 3.1.3
NOC-4:app noc$ gem list

*** LOCAL GEMS ***

actionmailer (3.1.3)
actionpack (3.1.3)
activemodel (3.1.3)
activerecord (3.1.3)
activeresource (3.1.3)
activesupport (3.1.3)
ansi (1.4.1)
arel (2.2.1)
builder (3.0.0)
bundler (1.0.21 ruby)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
erubis (2.7.0)
execjs (1.2.13)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.19)
json (1.6.4)
libv8 (3.3.10.4 x86_64-darwin-11)
mail (2.3.0)
mime-types (1.17.2)
multi_json (1.0.4)
mysql (2.8.1)
pg (0.12.2)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3)
railties (3.1.3)
rake (0.8.7)
rdoc (3.12)
ruby-mysql (2.9.4)
sass (3.1.12)
sass-rails (3.1.5)
sprockets (2.0.3)
sqlite3 (1.3.5)
therubyracer (0.9.9)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.2)
tzinfo (0.3.31)
uglifier (1.2.1)

=========================================================

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:59:46+00:00Added an answer on May 28, 2026 at 6:59 am

    I think you need to complete the limit for your password field.

       def self.up
         create_table :users do |t|
           t.string "first_name", :limit => 25
           t.string "last_name", :limit => 50
           t.string "email", :default => "", :null => false
           t.string "password", :limit => 32 # you're missing the value here
           t.timestamps
         end
       end
    

    The problem is that t.timestamps ends up being the value for your limit, as you can read from the resulting sql in the error explanation: password varchar(#)) ENGINE=InnoDB

    NOTE: you shouldn’t use a plain text field for a password. If you’re using rails 3.1 this could help you with this: http://railscasts.com/episodes/270-authentication-in-rails-3-1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Going through the SproutCore Getting started tutorial and have a problem. Inside the Todos.todoListController
Going through the Lynda training for Ruby on Rails and got to the point
I'm currently going through the Lynda Python tutorial and in the section on generators
When going through some of my applications in the past, I have noticed that
I have been going through the jqGrid wiki and havent been able to find
I'm going through Michael Hartl's Ruby on Rails 3.2 Tutorial and I'm confused about
Going through the Symblog tutorial of Symfony2, While creating forms I came to a
While going through a Zend tutorial , I came across the following statement: Note
While going through one project, I have seen that the memory data is 8
im going through the setup on http://www.railstutorial.org/chapters/static-pages#fig:autotest_green and im stuck on this particular error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.