Getting started with rails guide: Encountering problems at Section 5.1

387 views
Skip to first unread message

Jenson Lu

unread,
Aug 7, 2013, 12:28:57 PM8/7/13
to rubyonra...@googlegroups.com
Hi people,

I need some help here. I'm new to ROR, and is following the guideline on "Getting started with rails". The inputs have been accurate and are running well until section:

"5.1 Laying down the ground word"

While navigating to http://localhost:3000/posts/new  the error message display were:




ActiveRecord::PendingMigrationError

Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.

 





instead of what was suggested in the guide which is suppose to be:



Another routing error, uninitialized constant PostsController



How should I go resolve this issue? 

I'm currently using ruby 2.0.0 and Rails 4.0.0

Dheeraj Kumar

unread,
Aug 9, 2013, 6:38:04 AM8/9/13
to rubyonra...@googlegroups.com
Why don't you do what the error says?

run "rake db:migrate RAILS_ENV=development"

-- 
Dheeraj Kumar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f0ac2345-380b-4471-8c51-1193060f531b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Colin Law

unread,
Aug 9, 2013, 10:35:56 AM8/9/13
to rubyonra...@googlegroups.com
On 9 August 2013 11:38, Dheeraj Kumar <a.dheer...@gmail.com> wrote:
>
> Why don't you do what the error says?
>
> run "rake db:migrate RAILS_ENV=development"

Though you won't normally need RAILS_ENV=development as it should
default to that. First have a look in db/migrate and see if you have
accidentally created a new migration.

Colin


>
>
> --
> Dheeraj Kumar
>
> On Wednesday 7 August 2013 at 9:58 PM, Jenson Lu wrote:
>
> Hi people,
>
> I need some help here. I'm new to ROR, and is following the guideline on "Getting started with rails". The inputs have been accurate and are running well until section:
>
> "5.1 Laying down the ground word".
>
> While navigating to http://localhost:3000/posts/new the error message display were:
>
>
>
>
> ActiveRecord::PendingMigrationError
>
> Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.
>
>
>
>
>
>
>
> instead of what was suggested in the guide which is suppose to be:
>
>
>
>
>
>
>
> How should I go resolve this issue?
>
> I'm currently using ruby 2.0.0 and Rails 4.0.0
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f0ac2345-380b-4471-8c51-1193060f531b%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/B863061C9BD74218BBCDAC03727B20F1%40gmail.com.

Tamara Temple

unread,
Aug 9, 2013, 11:53:41 AM8/9/13
to rubyonra...@googlegroups.com

On Aug 7, 2013, at 11:28 AM, Jenson Lu <jenso...@gmail.com> wrote:

> Hi people,
>
> I need some help here. I'm new to ROR, and is following the guideline on "Getting started with rails". The inputs have been accurate and are running well until section:
> "5.1 Laying down the ground word".
> While navigating to http://localhost:3000/posts/new the error message display were:
>
> ActiveRecord::PendingMigrationError
> Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.
>
> instead of what was suggested in the guide which is suppose to be:

> How should I go resolve this issue?
>
> I'm currently using ruby 2.0.0 and Rails 4.0.0

At this stage of the game, it's hard to hear "yer doin it rong" but something did go wrong. You should not have received that message if you were following the getting started tutorial from the beginning. If you were doing other things, you may have created a migration which the system is complaining about. My suggestion at this point is to start the Getting Started tutorial from scratch with a brand new rails app in a brand new directory.


Jordon Bedwell

unread,
Aug 9, 2013, 12:30:19 PM8/9/13
to rubyonra...@googlegroups.com
On Fri, Aug 9, 2013 at 10:53 AM, Tamara Temple <tamous...@gmail.com> wrote:
> At this stage of the game, it's hard to hear "yer doin it rong" but something did go wrong. You should not have received that message if you were following the getting started tutorial from the beginning. If you were doing other things, you may have created a migration which the system is complaining about. My suggestion at this point is to start the Getting Started tutorial from scratch with a brand new rails app in a brand new directory.

WAT? Why would you start over when you could just rake db:migrate?
It's quite easy to miss that when it tells you to run it, and missing
it is a far better in how to correctly build migrations than being
told to do it, because now you've learned the hard way to always
migrate. I find it ignorant that anybody would tell somebody to start
over again rather than tell them how they broke it and to fix it and
the simple solution is: "You forgot to run a migration like they told
you to, lesson: run `rake db:migrate` after every migration.

Tamara Temple

unread,
Aug 9, 2013, 5:32:10 PM8/9/13
to rubyonra...@googlegroups.com
Up to that point in the tutorial, there should not have been any migrations created.

Colin Law

unread,
Aug 10, 2013, 4:43:42 AM8/10/13
to rubyonra...@googlegroups.com
Its all a bit irrelevant anyway since the OP has shown no further
interest. Perhaps he worked out what he was doing wrong and is too
embarrassed to reply.

Colin
Reply all
Reply to author
Forward
0 new messages