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

I can't show the contents of the db - I only get an bug report message

This is the message I get when I try to create an object from Posts.

" ..... edicate_builder/relation_handler.rb 1585 /Users/kitsco12/.rvm/gems/ruby-2.3.0/gems/activerecord-5.0.0.1/lib/active_record/relation/predicate_builder.rb 1586 /Users/kitsco12/.rvm/gems/ruby-2.3.0/gems/activerecord-5.0.0.1/lib/active_record/table_metadata.rb

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html "

It works fine otherwise. I can run the server. I can use commands, but when I try to show the contents (since we added "body:text" in this video) by typing: post = Post.all.

I've googled, but people are suggesting reinstalling Ruby. I don't think I need to do that, since ruby works fine. It's the db that seems to be the issue. I don't know how to fix it.

Source: https://github.com/kvitberg/ruby

I tried everything. I tried "rvm gem pristine", reverted to the last working version. Tried to create another project just to make sure I didn't mess up the blog project.

The solution was plain and simple: Reboot the computer.

Same problem occurred when I run the command "bin/rails generate migration AddBodyToPosts body:text" and then "bin/rails db:migrate". My best guess is that it occurs when trying to add a new column in the database. Any ideas?

David O' Rojo
David O' Rojo
11,051 Points

Your have to look carefully to to the error message displayed while trying to do rails db:migrate. Also, try to share the content of schema.rb and the most recent file under /db/migrate/.