我试图编程ruby时出错。 错误:C:/用户/ PC华硕/桌面/ g.rb:3:<main>': undefined local variable or method 'y' for main:Object (NameError)
红宝石错误:未定义的本地变量或方法
这里是我的代码:
puts " Do you like to install hacking pack?"
insta_one = gets.chomp
if insta_one == y
make
else
puts "Ok. Bye!"
end
def make
awe = file.new("shell.bat","w")
readme.puts("@echo off")
readme.puts("color a")
readme.puts("echo Installing hacking pack")
readme.puts("Thanks for downloading rootShell!")
readme.puts("My email - [email protected]")
end
你比较''ìnsta_one'''到unexistant'' 'y'''变量。你想要的是:'''如果insta_one =='y'''''。 – romainsalles 2015-01-04 12:22:23