rubinius/rubinius — Issue #1532: [1.9] Strange parser behavior
Author: y8
Created: 2012-01-25 22:05:09+00:00
State: open

### Environment

OS: ``OS X 10.7.2 (11C73, 64bit)``
rvm: ``rvm 1.10.2``
rbx: ``rubinius 2.0.0dev (1.9.3 d1c8aa95 yyyy-mm-dd JI) [x86_64-apple-darwin11.2.0]``

### STR:

0. Install rbx-head: ``rvm install rbx-head -- --enable-version=1.9,1.8 --default-version=1.9``
1. Create clean rvm gemset ``rvm use rbx-head@rbx-parser``
2. Install Rails v3.1.1 ``gem install rails -v 3.1.1 --no-ri --no-rdoc``
3. Create new rails application ``rails new rbx-test``
4. Replace Gemfile with following contents:

````ruby
source 'http://rubygems.org'

gem 'rails', '3.1.1'
gem 'devise', "~> 1.4.4"
gem 'cancan'
````

6. Bundle it ``bundle``
7. Try to start rails server: ``rails server``

OR

0. Clone this [repo](https://github.com/y8/rbx-d1c8aa95-parser)
1. Create clean rvm gemset ``rvm use rbx-head@rbx-parser``
2. Bundle it ``bundle``
3. Try to start rails server: ``rails server``

### Expected results

Rails server successfully started

### Actual results

It fails with exception ([show stack trace](https://gist.github.com/1679052)):

``undefined local variable or method `n_controller' on an instance of Object. (NameError)``

### Notes

If you change problematic [line](https://github.com/rails/rails/blob/ba708126d85a020f8984db1a12261bcdba47d70f/actionpack/lib/action_controller/log_subscriber.rb#L62) to:

````ruby
ActionController::LogSubscriber.attach_to :"action_controller"
````

You will get different exception ([show stack trace](https://gist.github.com/1679086)):

``unterminated string meets end of file``

And then, if you also add newline after ``:"action_controller"``, it will work just fine.