<p>I am working through a book which gives examples of Ranges being converted to equivalent arrays using their "to_a" methods</p>

<p>When i run the code in irb I get the following warning</p>

<pre><code> warning: default `to_a' will be obsolete
</code></pre>

<p>What is the the correct alternative to using to_a?</p>

<p>are there alternate ways to populate an array with a Range?</p>

This works for me in irb:
```
```
irb> (1..4).to_a
=> [1, 2, 3, 4]
```
```
I notice that:
```
```
irb> 1..4.to_a
(irb):1: warning: default `to_a' will be obsolete
ArgumentError: bad value for range
        from (irb):1
```
```
So perhaps you are missing the parentheses?
(I am running Ruby 1.8.6 patchlevel 114)