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.

User controller crashes with Ruby 1.8.7

#153

The render json: syntax causes problems in Ruby 1.8.7. Assuming Ruby 1.8.7 is suppose to work with Rails 3.1, we should probably fix this. See the below log:

var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:10: syntax error, unexpected ':', expecting '}' (SyntaxError)

  format.json { render json: @users }
                            ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:21: syntax error, unexpected ':', expecting '}'

  format.json { render json: @user }
                            ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:32: syntax error, unexpected ':', expecting '}'

  format.json { render json: @user }
                            ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:48: syntax error, unexpected ':', expecting '}' ...l { redirect_to @user, notice: 'User was successfully create...

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:49: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user, status: :created, loca...

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:49: syntax error, unexpected ':', expecting '=' ... { render json: @user, status: :created, location: @user }

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:51: syntax error, unexpected ':', expecting '}'

    format.html { render action: "new" }
                                ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:52: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user.errors, status: :unproc...

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:52: syntax error, unexpected ':', expecting '=' ...er json: @user.errors, status: :unprocessable_entity }

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:64: syntax error, unexpected ':', expecting '}' ...l { redirect_to @user, notice: 'User was successfully update...

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:67: syntax error, unexpected ':', expecting '}'

    format.html { render action: "edit" }
                                ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:68: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user.errors, status: :unproc...

                          ^

/var/rails/c2_auto/bigtuna/builds/concerto/build_20_20110601024035/app/controllers/users_controller.rb:68: syntax error, unexpected ':', expecting '=' ...er json: @user.errors, status: :unprocessable_entity }

                          ^

Reported by Brian Michalski · June 1st, 2011 @ 01:41 AM

State: resolved
Assigned to: Zach Rowe Zach Rowe

Activity

  1. August
    August

    Could this be related to the fact that in Rails 3.1, JSON is the new default output for ActiveResource?

    June 1st, 2011 @ 11:02 AM

  2. August
    August

    While I can't reproduce the old 1.8.7 environment anymore, you may want to try different syntax. format.json { render :json => @users } instead of format.json { render json: @users }.

    June 1st, 2011 @ 11:07 AM

  3. Brian Michalski
    Brian Michalski

    Zach - I believe senatedev is still running Ruby 1.8.7, any chance you can
    take a look at this? Running any action from the users controller should
    throw one of these errors.

    ---------- Forwarded message ---------- From: Lighthouse <no-reply@lighthouseapp.com>
    Date: Wed, Jun 1, 2011 at 8:08 AM
    Subject: [Concerto #153 User controller crashes with Ruby 1.8.7] User controller crashes with Ruby 1.8.7
    To: "michab3@rpi.edu" <michab3@rpi.edu>

    June 1st, 2011 @ 12:54 PM

  4. August
    August

    Haris reported a problem with senatedev and Rails 3.1 last evening. Apparently senatedev interprets /assets URLs as being /var/www/assets, probably as a result of the way directories are setup on senatedev. This seems to prevent a Rails 3.1 app from fully working on senatedev, absent some workaround...

    June 1st, 2011 @ 03:02 PM

  5. Zach Rowe
    Zach Rowe

    Same here

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:10: syntax error, unexpected ':', expecting '}'

      format.json { render json: @users }
                                ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:21: syntax error, unexpected ':', expecting '}'

      format.json { render json: @user }
                                ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:32: syntax error, unexpected ':', expecting '}'

      format.json { render json: @user }
                                ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:48: syntax error, unexpected ':', expecting '}' ...l { redirect_to @user, notice: 'User was successfully create...

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:49: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user, status: :created, loca...

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:49: syntax error, unexpected ':', expecting '=' ... { render json: @user, status: :created, location: @user }

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:51: syntax error, unexpected ':', expecting '}'

        format.html { render action: "new" }
                                    ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:52: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user.errors, status: :unproc...

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:52: syntax error, unexpected ':', expecting '=' ...er json: @user.errors, status: :unprocessable_entity }

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:64: syntax error, unexpected ':', expecting '}' ...l { redirect_to @user, notice: 'User was successfully update...

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:67: syntax error, unexpected ':', expecting '}'

        format.html { render action: "edit" }
                                    ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:68: syntax error, unexpected ':', expecting '}' ... format.json { render json: @user.errors, status: :unproc...

                              ^
    

    /var/rails/rowez/concerto/app/controllers/users_controller.rb:68: syntax error, unexpected ':', expecting '=' ...er json: @user.errors, status: :unprocessable_entity }

                              ^
    

    Yeah, I found stylesheet_link_tag pointing to var/www/assets. Hmm...

    June 1st, 2011 @ 05:30 PM

  6. August
    August
    • State changed from new to resolved
    • Assigned user set to Zach Rowe

    June 1st, 2011 @ 06:14 PM

  7. Brian Michalski

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.