Ruby - String Operations
The following code is intended to replace all occurrences of 'apple' with 'orange' in the string, but it only replaces the first one. What is the error?
fruit = "apple banana apple grape"
new_fruit = fruit.sub('apple', 'orange')
puts new_fruit