appoxy / aws

Amazon Web Services (AWS) Ruby Gem
https://rubygems.org/gems/aws
236 stars 87 forks source link

ec2.rb is not compatible with ruby-1.9.x #112

Closed davetchen closed 12 years ago

davetchen commented 12 years ago

Hi, I'm trying to use appoxy/aws in a new project with Rails 3.2 and ruby-1.9.3-p125 and am getting an error on launch_instances()

Cannot find the method "to_a" in: /usr/local/rvm/gems/ruby-1.9.3-p125@rails32x/bundler/gems/aws-62f71d007b5b/lib/ec2/ec2.rb:535:in `launch_instances'

We had no problems with an older project using ruby-1.8.7 Thanks for the gem and your help!

davetchen commented 12 years ago

I found a (relatively) simple solution by changing

str.to_a

To:

str.lines.to_a

throughout the file.

treeder commented 12 years ago

Can you give us a pull request?

davetchen commented 12 years ago

Hi treeder, I found a simpler work-around by making sure to call

EC2.launch_instances("ami-12345678", :group_ids => ["permissions"])

rather than

EC2.launch_instances("ami-12345678", :group_ids => "permissions")

It seems for ruby-1.9.x it is safer to pass in an Array at all times. I'll go ahead and Close this issue for now. Thanks! -dave