johnnyhalife / waz-storage

A simple implementation of Windows Azure Storage API for Ruby, inspired by the S3 gems and self experience of dealing with queues. The major goal of the whole gem is to enable ruby developers [like me =)] to leverage Windows Azure Storage features and have another option for cloud storage.
http://waz-storage.heroku.com
MIT License
40 stars 21 forks source link

Error using gem from Windows7 for Table Storage (UTF encoding problem?) #3

Closed writeameer closed 14 years ago

writeameer commented 14 years ago

Hi there Johnny,

I tried using your gem from Ruby 1.9 to create a test table:

require 'waz-storage'
require 'waz-tables'
require 'waz-queues'

WAZ::Storage::Base.establish_connection!(:account_name => 'account name here', :access_key => 'key-here')

table = WAZ::Tables::Table.create('TestTable')

and received error:

C:/Ruby19/lib/ruby/gems/1.9.1/gems/waz-storage-1.0.0/lib/waz/storage/core_service.rb:73:in `generate_signature': undefined method `toutf8' for # (NoMethodError)
        from C:/Ruby19/lib/ruby/gems/1.9.1/gems/waz-storage-1.0.0/lib/waz/storage/core_service.rb:28:in `generate_request'
        from C:/Ruby19/lib/ruby/gems/1.9.1/gems/waz-storage-1.0.0/lib/waz/storage/core_service.rb:108:in `execute'
        from C:/Ruby19/lib/ruby/gems/1.9.1/gems/waz-storage-1.0.0/lib/waz/tables/service.rb:21:in `create_table'
        from C:/Ruby19/lib/ruby/gems/1.9.1/gems/waz-storage-1.0.0/lib/waz/tables/table.rb:47:in `create'
        from C:/Progs/Ruby/AzureTest/lib/main.rb:13:in `
'

I cloned the github repo and ran rake:

PS C:\Github\waz-storage\waz-storage> rake
(in C:/Github/waz-storage/waz-storage)
rake aborted!
C:/Github/waz-storage/waz-storage/rakefile:46: invalid multibyte char (US-ASCII)
C:/Github/waz-storage/waz-storage/rakefile:46: invalid multibyte char (US-ASCII)
C:/Github/waz-storage/waz-storage/rakefile:46: syntax error, unexpected $end, expecting keyword_end
...indows Azure Storage library ΓÇö simple gem for accessing WA...
...                               ^
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
(See full trace by running task with --trace)
PS C:\Github\waz-storage\waz-storage> 

I tried running the same code from my imac and no issues. Apologize if this is a newbie question. Would you know how I can get this working from Windows?

Ameer.

writeameer commented 14 years ago

Works fine with Ruby 1.8.7 on Windows. Above problem only seems to happen with Ruby 1.9. Is this expected?

johnnyhalife commented 14 years ago

Yes it's expected since we didn't test it on Ruby 1.9, there's a workaround for 1.9 and we will work around it soon. Thanks for the issue report.

writeameer commented 14 years ago

Thanks very much Johnny.