Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Chase Lee
Chase Lee
29,275 Points

Treebook Status Problem

Hi everyone,

I am do the "Build a Simple Ruby on Rails Application" project and when I try to make a now status or edit one something strange happens, it takes me to this page. And instead of this url:

http://localhost:3000/statuses

I get this one:

http://localhost:3000/statuses/1

Can anyone please me what is wrong.

Thanks.

Note: The code that I have is downloaded from stage two.

8 Answers

Chase Lee
Chase Lee
29,275 Points

Thanks for the tips guys. I don't know what went wrong so I just downloaded the files from the next stage.

Luke Ward
Luke Ward
9,154 Points

Hi Chase, have you tried doing rake db:migrate as your database might not match whats in the model and controller code.

I agree with Luke. Recreate your database with :

rake db:drop:all
rake db:create:al
rake db:migrate

then have a look inside your controller and make sure everything is fine. post some more code of your work if there was still a problem

Chase Lee
Chase Lee
29,275 Points

I had some problems with the terminal. Maybe that's what's wrong. Nima Shariatian I tried what you said and here is what I got:

unknown549b12ce6ed3:~ Chase$ cd desktop/treehouse/ruby/treebook/
unknown549b12ce6ed3:treebook Chase$ rails server
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
unknown549b12ce6ed3:treebook Chase$ rake db:drop:all
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
unknown549b12ce6ed3:treebook Chase$ rake db:create:al
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
unknown549b12ce6ed3:treebook Chase$ rake db:migrate
Could not find i18n-0.6.0 in any of the sources
Run `bundle install` to install missing gems.
unknown549b12ce6ed3:treebook Chase$ 

I have no idea what I'm doing.

Luke Ward
Luke Ward
9,154 Points

Chase try doing a bundle install then follow Nima's instructions.

Chase Lee
Chase Lee
29,275 Points

Sorry, not sure how to do that. All of these ruby tutorials are just going over my head.

Luke Ward
Luke Ward
9,154 Points

Type in command prompt bundle install. This then installs all the gems that you specified in your Gemfile.

seems like you are missing gems, do a

 bundle update 

then try to remake your database and start the server after its hard to debug this without seeing your code