Doubts about variables in ruby

well my doubt is:

I want to make a ruby program that number in a URL and checks if the url
has a forum. for exemple :

puts(“enter an address”);
endereco =gets()
@forum = “/forum”
system("firefox "+ endereco+ @forum);

the code does not work, it opens the page with the site but the variable
@ forum runs only after I close the open page, and as command not found
(like I try to use the command / forum)

how can i put it all together and make url.com / forum?

PS : Sorry for my spelling errors, I’m from Brazil :smiley:

On Dec 31, 9:41 pm, Junior L. [email protected] wrote:

the code does not work, it opens the page with the site but the variable
@ forum runs only after I close the open page, and as command not found
(like I try to use the command / forum)

how can i put it all together and make url.com / forum?

PS : Sorry for my spelling errors, I’m from Brazil :smiley:

Posted viahttp://www.ruby-forum.com/.

gets() retains the newline when the user presses enter
try stripping the newline (endereco = gets().chomp)