This project is archived and is in readonly mode.

#827 ✓committed
Tom Lea

String#each_char 1.9 syntax fix

Reported by Tom Lea | August 14th, 2008 @ 02:26 PM | in 2.x

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>'

Comments and changes to this ticket

  • josh

    josh November 22nd, 2008 @ 07:19 PM

    • Assigned user set to “Jeremy Kemper”
  • Jeremy Kemper

    Jeremy Kemper November 23rd, 2008 @ 06:50 AM

    • State changed from “new” to “committed”

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

  • Tom Lea

    Tom Lea November 23rd, 2008 @ 06:40 PM

    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


Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket

Referenced by