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 Ruby Collections Build a Grocery List Program Build a Grocery List Program: Part 1

This code does not work in Workspace...

I understand how this code should work. But even when copy/pasting into workspace, it does not return anything.

3 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I copied the code into new Workspace ruby file, executed it in the terminal and it behaves the same way as the videos show. What steps did you take and how did it fail for you?

same thing, copied code into new workspace ruby file. it asks for list name, then just returns to normal. doesn't do anything else.

treehouse:~/workspace$ ruby shopping_list.rb
What is the list name?Groceries
treehouse:~/workspace$

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

You are sure you have this last line as well in the file?

puts list.inspect

If so, please contact Support (link on the right) and describe the problem in detail.

i had to restart workspace... thank you for your help good SIR

Hunter Garrett
Hunter Garrett
6,339 Points

Did you file -> save? Sounds silly, but I forgot to do this and it won't run until you save it :P

Jonathan Sanchez
Jonathan Sanchez
8,080 Points

Yep at first the

  .inspect 

was breaking the workspace. However, after reloading the workspace it worked with the .INSPECT