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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:50:21+00:00 2026-06-17T15:50:21+00:00

after running rake db:reset i rund rake db:populate and i’m getting this error don’t

  • 0

after running rake db:reset
i rund rake db:populate and i’m getting this error don’t know where it’s coming from

rake aborted!
undefined method `+' for 4..5:Range

Tasks: TOP => db:populate
(See full trace by running task with --trace)

in my task folder

namespace :db do
  desc " Fill database with sample data"
  task populate: :environment do
     admin = User.create!(name: "Emple User", 
                          email: "exampel@railstuttorial.org",    
                          password: "password",
                          password_confirmation: "password")
  admin.toggle!(:admin)                 
     99.times do |n|
        name = Faker::Name.name
        email = "example-#{n + 1}@railstutorial.org"
        password = "password"
        User.create!(name: name, email: email, password: password,     
                     password_confirmation: password)
     end   
     users = User.all(limit: 6)
     50.times do
       content = Faker::Lorem.sentence(4..5)
       users.each { |user| user.microposts.create!(content: content) }
       content = nil 
     end             
  end


end
  • 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-06-17T15:50:23+00:00Added an answer on June 17, 2026 at 3:50 pm

    You are passing a range to Faker::Lorem.sentence in your 50.times loop.

    I’m not sure what you’re trying to achieve but that method is expecting an integer (did you mean 4 or 5?) and when it tries to add something to it within the Faker::Lorem code it is causing that error.

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

Sidebar

Related Questions

After running this query statement with my database: select * from articles where content
I'm getting an error when running rake assets:precompile on my production server. As far
I am getting am error when running rake db:migrate. I have recently added a
After heroku rake db:migrate I get the following error: rake aborted! no such file
How do you make the documentation available after running rake doc:app available within your
The following output appears after running some rake tasks: Loaded suite /usr/bin/rake Started Finished
After running code from my previous question , I get a result set from
This part of question is a part of this question Previous Question After running
I created a config/sphinx.yml file with the line: morphology: stem_en After running rake ts:config,
I am running heroku run rake db:migrate after I have deployed my app to

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.