Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

String#each_char 1.9 syntax fix

#827

Hi, Was curious and tried rails with 1.9.. found it broke at start-up.

This was due to || not accepting a void expression on it's RHS.

This syntax error causes rails to bail hard as soon as the AS gem is loaded.

Attached should be a patch.

Below is the error output:


sysdevmac-01:rails_master_vanila norman$ rails1.9  -f ~/fish_tracker
/usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext/string.rb:5:in `require': /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext/string/iterators.rb:16: void value expression (SyntaxError)
          loop { yield(scanner.scan(char) || break) }
                                                   ^	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext/string.rb:5:in `<top (required)>'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext.rb:3:in `require'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext.rb:3:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext.rb:1:in `each'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support/core_ext.rb:1:in `<top (required)>'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support.rb:31:in `require'
	from /usr/local/lib/ruby/gems/1.9.0/gems/activesupport-2.1.0/lib/active_support.rb:31:in `<top (required)>'
	from /usr/local/lib/ruby/gems/1.9.0/gems/rails-2.1.0/lib/rails_generator.rb:28:in `require'
	from /usr/local/lib/ruby/gems/1.9.0/gems/rails-2.1.0/lib/rails_generator.rb:28:in `<top (required)>'
	from /usr/local/lib/ruby/gems/1.9.0/gems/rails-2.1.0/bin/rails:13:in `require'
	from /usr/local/lib/ruby/gems/1.9.0/gems/rails-2.1.0/bin/rails:13:in `<top (required)>'
	from /usr/local/bin/rails1.9:19:in `load'
	from /usr/local/bin/rails1.9:19:in `<main>'

Reported by Tom Lea · August 14th, 2008 @ 02:26 PM

State: committed
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. josh
    josh
    • Assigned user set to Jeremy Kemper

    November 22nd, 2008 @ 07:19 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to committed

    Do you have a current 1.9 build? This works for me. I prefer your code, anyway, though :)

    November 23rd, 2008 @ 06:50 AM

  3. Tom Lea
    Tom Lea

    It was quite an old build, but was the best I could find at the time the ticket was raised:

    
    $ ruby1.9 -v
    ruby 1.9.0 (2007-12-25 revision 14709) [i686-darwin9.4.0]
    $ ls -l `which ruby1.9`
    -rwxr-xr-x  1 root  wheel  1509668 29 Jul 15:11 /usr/local/bin/ruby1.9
    

    Thanks.

    November 23rd, 2008 @ 06:40 PM