#19 Superclass missmatch error


#1
class Message
    
    @@messages_sent = 0
    
    def initialize(from, to)
        @from = from
        @to = to
        @@messages_sent += 1
    end
    
end

class Email < Message
    def initialize(subject)
        @subject = subject
    end
end

my_message = Message.new('Dio', 'Rush')

When I submit this it returns the error "superclass mismatch for class Email"

Any pointers on where to look?


#2

I've got the same message!

I think it's a 'site specific error'! I've run it on a simple ruby installation and
it didn't cause any errors.

UPDATE! Try a ctrl-f5 in your browser, that's heleped me,


#3

I'm getting the same, and the control-f5 trick isn't working for me.

UPDATE: I just clicked on the notifications icon in the upper right, which took me to a different page, then hit the back button on the browser, and that forced a clean reload (which the f5 didn't do), and now it works.


#4

Thanks. I can confirm that this worked. Cheers for sharing mollac


#5

CMD+SHIFT+R works on Mac instead o CTL+F5.


#6

https://www.codecademy.com/en/courses/ruby-beginner-en-MFiQ6/3/4?curriculum_id=5059f8619189a5000201fbcb#.....tell me buddy what to do?


#7

Thanks! You think they would have fixed that by now.


#8

Still not fixed! I refreshed the browser and it worked fine though.


#9

class Message
@@messages_sent = 0
def initialize(from, to)
@from = from
@to = to
@@messages_sent += 1
end
end

my_message = Message.new("me", "you")

class Email < Message
def initialize(subject)
@subject = subject
end
end


#10

All of you guys were actually right about this exercise, by the way thanks mollac, for the tip. Also, I tried pressing the F5 key on my laptop to refresh the site and the code eventually worked out in the end. (so you don't really need to press Ctrl + F5 if your computer and/or laptop is manufactured different though which is another different matter to concern with)


#11

Hey guys.

I've got a similar problem with the same code :

class Message
@@messages_envoyes = 0
def initialize(de, a)
@de = de
@a = a
@@messages_envoyes += 1
end
end

class Email < Message
def initialize(sujet)
@sujet = sujet
end
end

mon_message = Message.new("Toto", "Tata")

Error :
Oups, merci de réessayer.
La méthode initialize de Email a-t-elle un unique paramètre : 'sujet' ?

But even if i refreshed the page with F5 or CTRL+F5, it's impossible to done this chapter...
Someone have an another answer to help me with this problem?

Thank you.


#12

Try the cut and paste method copy your code place it in a work doc or forum question then cut copy and paste into the code editor, that's how I got mine to work. Nothing else worked.


#13

Thanks that worked for me too.


#14

hi ,

I have the same problem but nothing works.

someone have another idea ?

thanks


#15

Hi anthob

this code worked for me

class Email < Message
def initialize(sujet)
@sujet = sujet
super initialize(sujet)
end
end


#16

i love you :wink:

thanks it works


#17

try by putting a line like :
super initialize ( sujet)
between @sujet line and the end line

it works for me


#18

Thanks ! I tried everithing else and that's the only thing who worked


#19