Ruby: “Unexpected keyword_end”… but all openers and closers match
问题 I'm working on a block of code that will return the nth prime to the user. I'm getting "unexpected keyword_end" syntax errors for lines 19 and 22. I put comments in the code so you can find the locations of the errors easily. def nthPrime(n) number = 3 primeNumber = 1 i = 0 primes = [2] #Iterates the number until we've found the desired number of primes. while primeNumber < n #Iterates through the prime numbers already found to locate prime factors. while i < primes.length #Returns TRUE if a