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 Objects and Classes Variables and Methods Attribute Writers and Accessors

dharshi thiru
dharshi thiru
3,203 Points

It gives error task 1 no longer parsing. When i go back and check Task 1 it parses fine.

class Name attr_reader :title attr_writer :first_name attr_accessor : :last_name

def initialize(title, first_name, middle_name, last_name) @title = title @first_name = first_name @middle_name = middle_name @last_name = last_name end end

name.rb
class Name
  attr_reader :title
  attr_writer :first_name
  attr_accessor : :last_name

  def initialize(title, first_name, middle_name, last_name)
    @title = title
    @first_name = first_name
    @middle_name = middle_name
    @last_name = last_name
  end
end

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! The error message actually says that it's "no longer passing", not parsing. And this is an indication of a syntax error. In your case, in step 2 you've got a typo on this line:

  attr_accessor : :last_name

It should be:

  attr_accessor :last_name

Note that your original version has an extra colon in it. I feel like this was just a typo. Good luck and happy coding! :sparkles: