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

Alphonse Cuccurullo
Alphonse Cuccurullo
2,513 Points

Help me please?

strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]

symbols = []

strings.each {|s| s.to_sym.push(symbols)}

The goal is to convert the strings in the string array into symbols and add them to the symbols array. Everytime i try this its tells me that the html symbol isnt factoring. Here is the link.

https://www.codecademy.com/courses/ruby-beginner-en-Qn7Qw/1/4?curriculum_id=5059f8619189a5000201fbcb#

1 Answer

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,850 Points

HI Alphonse,

You want to call push on the symbols array and pass it the string converted to a symbol; the way you have it, push is being called on the string, converted to a symbol.

strings.each {|s| symbols.push(s.to_sym)}

Best,

Clayton