[MacRuby] #783: Patch for builder.rb error: invalid byte sequence in US-ASCII
#783: Patch for builder.rb error: invalid byte sequence in US-ASCII -------------------------------+-------------------------------------------- Reporter: slewsys@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- As of MacRuby subversion Revision: 4343, following build instructions per ./README.rdoc fails with error message "invalid byte sequence in US- ASCII". This is a known issue with Ruby 1.9 which can be resolved by adding an argument to IO.open/read. In the case of MacRuby's builder.rb, changing File.read(src) to File.read(src, { :mode => "rb" }) resolves the issue. Patch follows: {{{ Index: rakelib/builder/builder.rb =================================================================== --- rakelib/builder/builder.rb (revision 4343) +++ rakelib/builder/builder.rb (working copy) @@ -142,7 +142,7 @@ end def locate_headers(cont, src) - txt = File.read(src) + txt = File.read(src, { :mode => "rb" }) txt.scan(/#include\s+\"([^"]+)\"/).flatten.each do |header| p = header_path(header) if p and !cont.include?(p) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/783> MacRuby <http://macruby.org/>
#783: Patch for builder.rb error: invalid byte sequence in US-ASCII -------------------------------+-------------------------------------------- Reporter: slewsys@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by martinlagardette@…): What is your configuration exactly? On 64bits 10.6.4 I was able to build & install r4343 without issue. -- Ticket URL: <http://www.macruby.org/trac/ticket/783#comment:1> MacRuby <http://macruby.org/>
#783: Patch for builder.rb error: invalid byte sequence in US-ASCII -------------------------------+-------------------------------------------- Reporter: slewsys@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by slewsys@…): Replying to [comment:1 martinlagardette@…]:
What is your configuration exactly? On 64bits 10.6.4 I was able to build & install r4343 without issue.
I am on 10.6.4, but I also have Ruby 1.9 in my path. Although MacRuby derives from Ruby 1.9, I'm assuming that builder.rb was written for /usr/bin/ruby, which is version 1.8, thus the patch. -- Ticket URL: <http://www.macruby.org/trac/ticket/783#comment:2> MacRuby <http://macruby.org/>
#783: Patch for builder.rb error: invalid byte sequence in US-ASCII -------------------------------+-------------------------------------------- Reporter: slewsys@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 0.7 => Comment: Unfortunately this patch will break 1.8 rake since IO.open does not accept a hash argument. I am wondering if we couldn't use a magic comment here for 1.9. -- Ticket URL: <http://www.macruby.org/trac/ticket/783#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby