Re: [MacRuby-devel] Experiences with m17N using PostgreSQL with macruby

2011-08-27 Thread Eloy Duran
In principle MRI is always right, so unless there's a comment or spec that 
explains why we deviate it's a bug.

Eloy

On 24 aug. 2011, at 18:19, Steve Clarke wrote:

> I want to use PostgreSQL with macruby.  
> 
> At first I couldn't make this work.  I eventually had some success and 
> learned quite a lot on the way.  I'm not sure whether I found a bug in 
> macruby but it certainly behaves differently from ruby 1.9.2-p290 installed 
> from macports. The latter worked with postgres with no problems.
> 
> My first try was with macruby 0.10 stable.  I couldn't get the pg gem 
> (pg-0.11.0) to compile and eventually gave up.  There were lots of obscure 
> errors which I regret I've not recorded.
> 
> I then moved onto macruby 0.11 which I compiled from source that I checked 
> out today.  pg-0.11.0 now compiled but when I tried to use postgres from my 
> macruby test I aborted with a failed dynamic link to ENCODING_GET_INLINED.  I 
> soon realised this was another name for ENCODING_GET and I added the 
> definition to macruby's encoding.h.
> 
> I could now get as far as connecting to postgres and retrieving a result set. 
>  However, as son as I tried to examine any of the values in the result set I 
> aborted:
> 
> Assertion failed: (idx >= 0 && idx < ENCODINGS_COUNT), function 
> rb_enc_associate_index, file encoding.c, line 590.
> Abort trap: 6
> 
> I eventually found that pg was passing an idx of -1.  I modified the the pg 
> code to prevent this happening and it now works fine, as far as I've gone.
> 
> It seems to me that pg should not pass an index of -1.  ruby 1.9.2-p290 
> however seems to accept it.  So who's right ?
> 
> Hope this is of interest to someone.
> 
> Steve
> 
> 
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] AWS-S3 gem doesn't work with MacRuby

2011-08-27 Thread Eloy Duran
I haven’t used this library on MacRuby, so unless someone else knows of a 
workaround the only solution is to fix it. It would be great if you could 
reduce the actual problem to a few lines of code and file a ticket, even if 
there's a workaround :)

Eloy

On 25 aug. 2011, at 21:25, Jeremy Smith wrote:

> This works when I try it in MRI.  But this is what happens in Macruby.  Is 
> there a workaround?
> 
> $ macirb -f
> irb(main):003:0> require 'aws/s3'
> => true
> irb(main):006:0> AWS::S3::Base.establish_connection!(
> irb(main):007:0> :access_key_id => ACCESS_KEY,
> irb(main):008:0> :secret_access_key => SECRET_ACCESS_KEY
> irb(main):009:0> )
> => # @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"", 
> :secret_access_key=>""} @access_key_id="" @secret_access_key="" 
> @http=#>
> irb(main):010:0> AWS::S3::Service.buckets
> NameError: `@policy:' is not allowed as an instance variable name
>   
> /Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:142:in
>  `expirable_memoize:'
>   
> /Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in
>  `policy:'
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] AWS-S3 gem doesn't work with MacRuby

2011-08-27 Thread Eloy Duran
Actually, googling did reveal some Objective-C code for S3, which is a possible 
workaround.

HTH

On 25 aug. 2011, at 21:25, Jeremy Smith wrote:

> This works when I try it in MRI.  But this is what happens in Macruby.  Is 
> there a workaround?
> 
> $ macirb -f
> irb(main):003:0> require 'aws/s3'
> => true
> irb(main):006:0> AWS::S3::Base.establish_connection!(
> irb(main):007:0> :access_key_id => ACCESS_KEY
> irb(main):008:0> :secret_access_key => SECRET_ACCESS_KEY
> irb(main):009:0> )
> => # @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"", 
> :secret_access_key=>""} @access_key_id="" @secret_access_key="" 
> @http=#>
> irb(main):010:0> AWS::S3::Service.buckets
> NameError: `@policy:' is not allowed as an instance variable name
>   
> /Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:142:in
>  `expirable_memoize:'
>   
> /Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in
>  `policy:'
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel