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 1070585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:35:07+00:00 2026-05-16T20:35:07+00:00

I’ve got a table where I used integer on a field which needs decimal

  • 0

I’ve got a table where I used integer on a field which needs decimal places, so I’m trying to create a migration which changes the field type from integer to float/real. My database is sqllite3 and I’m using rails3.

I ran

rails generate migration ChangeMeasureColumnOnIngredients

to create the initial migration files, then updated the class to

class ChangeMeasureColumnOnIngredients < ActiveRecord::Migration
  def self.up
    change_column :ingredients, :measure, :real
  end

I ran rake db:migrate and it returned fine.

When I inserted a value via my rails app, it didn’t return the decimal place. I started to think that many rails doesn’t know what ‘real’ is as a datatype, so I changed the migration to

change_column :ingredients, :measure, :float

I then ran

rake db:migrate change_measure_column_on_ingredients

and now I get the following error

c:\Ruby192\rails3rc>rake db:migrate change_measure_column_on_ingredients
(in c:/Ruby192/rails3rc)
rake aborted!
Don't know how to build task 'change_measure_column_on_ingredients'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1720:in []'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2040:ininvoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:ineach'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:instandard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:inrun'
C:/Ruby192/bin/rake:31:in `'

I tried changing the :float back to :real, but I still get that error.

can somebody tell me what I’m doing wrong?
I’m new to rails and still learning.

  • 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-16T20:35:08+00:00Added an answer on May 16, 2026 at 8:35 pm

    Your rake call has instructed rake to build the task db:migrate followed by the task change_measure_column_on_ingredients which clearly isn’t want you want as the latter is not a rake task.

    To run a specific migration you need to provide the VERSION of the migration. This is the number in the file name which comes before your name for the migration. You can migrate it up or down like this:

    rake db:migrate:down VERSION=123456789
    rake db:migrate:up VERSION=123456789
    

    Alternatively you can take the last migration down then up by doing the following (you can also specify a VERSION for this):

    rake db:migrate:redo
    

    There are other options though. If you run rake --describe db:migrate you’ll get some more information.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to select an H1 element which is the second-child in its group
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words

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.