Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3.1 - deployment to Heroku, syntax error in redirect_to call, expecting keyword_end ; works locally
    primarykey
    data
    text
    <p>I have an application who works fine locally, but breaks with a syntax error on heroku, on a file whose syntax is successfully verified by my local version of ruby. <br> <br> The application is a new Rails 3.1 application. It works locally.<br> I just tried to push it to heroku (first time for this app). I am confident all the code has been committed, and pushed to heroku.<br> The migration (<code>heroku run rake db:migrate</code>) worked.</p> <p>When I tried to run the application, I got the error page. Here is an extract from the logs. Full logs from the console at the end of this question.</p> <pre><code>2012-01-09T21:31:36+00:00 app[web.1]: Exiting 2012-01-09T21:31:36+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': /app/app/controllers/ios_applications_controller.rb:32: syntax error, unexpected tASSOC, expecting ')' (SyntaxError) 2012-01-09T21:31:36+00:00 app[web.1]: ...on_path ( :bundle_identifier =&gt; params[:bundle_identifier] )... 2012-01-09T21:31:36+00:00 app[web.1]: ... ^ 2012-01-09T21:31:36+00:00 app[web.1]: /app/app/controllers/ios_applications_controller.rb:32: syntax error, unexpected ')', expecting keyword_end 2012-01-09T21:31:36+00:00 app[web.1]: ...=&gt; params[:bundle_identifier] ), :notice =&gt; "No iOS applicat... 2012-01-09T21:31:36+00:00 app[web.1]: ... ^ </code></pre> <p>Note the <code>app/app/...</code> weird path (locally, I don't have this weird structure). This is similar to <a href="https://stackoverflow.com/questions/6181958/rails-app-isnt-working-in-heroku">this question</a> (no helpful answers).</p> <p>Here is the relevant code of the file <code>ios_applications_controller.rb</code>:</p> <pre><code>def show @ios_application = IosApplication.find(params[:id]) if (params[:id]) @ios_application = IosApplication.find_by_application_bundle_identifier(params[:bundle_identifier]) if @ios_application.nil? &amp;&amp; params[:bundle_identifier] if @ios_application.nil? # The line below is the mentioned line (32) redirect_to new_ios_application_path ( :bundle_identifier =&gt; params[:bundle_identifier] ), :notice =&gt; "No iOS application found for #{params[:bundle_identifier]}. Would you like to create it?" # This does not work either: # redirect_to new_ios_application_path, :bundle_identifier =&gt; params[:bundle_identifier], :notice =&gt; "No iOS application found for #{params[:bundle_identifier]}. Would you like to create it?" return end respond_to do |format| format.html # show.html.erb format.json { render :json =&gt; @ios_application } end end </code></pre> <p><br> A syntax check on the file shows no error:</p> <pre><code>$ ruby -wc app/controllers/ios_applications_controller.rb Syntax OK </code></pre> <p>Locally, I am running ruby 1.8.7 and Rails 3.1.3.<br> On heroku, I am using the cedar stack: </p> <pre><code>$ heroku stack aspen-mri-1.8.6 bamboo-mri-1.9.2 bamboo-ree-1.8.7 * cedar (beta) </code></pre> <p><br> <hr> Full logs:</p> <pre><code>$ heroku logs --tail 2012-01-09T21:31:21+00:00 heroku[api]: Add-on add logging:basic by guillaume@macmation.com 2012-01-09T21:31:21+00:00 heroku[api]: Release v5 created by guillaume@macmation.com 2012-01-09T21:31:22+00:00 heroku[web.1]: State changed from crashed to created 2012-01-09T21:31:22+00:00 heroku[web.1]: State changed from created to starting 2012-01-09T21:31:28+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 55950` 2012-01-09T21:31:36+00:00 app[web.1]: =&gt; Booting WEBrick 2012-01-09T21:31:36+00:00 app[web.1]: =&gt; Rails 3.1.3 application starting in production on http://0.0.0.0:55950 2012-01-09T21:31:36+00:00 app[web.1]: =&gt; Call with -d to detach 2012-01-09T21:31:36+00:00 app[web.1]: =&gt; Ctrl-C to shutdown server 2012-01-09T21:31:36+00:00 app[web.1]: Exiting 2012-01-09T21:31:36+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': /app/app/controllers/ios_applications_controller.rb:32: syntax error, unexpected tASSOC, expecting ')' (SyntaxError) 2012-01-09T21:31:36+00:00 app[web.1]: ...on_path ( :bundle_identifier =&gt; params[:bundle_identifier] )... 2012-01-09T21:31:36+00:00 app[web.1]: ... ^ 2012-01-09T21:31:36+00:00 app[web.1]: /app/app/controllers/ios_applications_controller.rb:32: syntax error, unexpected ')', expecting keyword_end 2012-01-09T21:31:36+00:00 app[web.1]: ...=&gt; params[:bundle_identifier] ), :notice =&gt; "No iOS applicat... 2012-01-09T21:31:36+00:00 app[web.1]: ... ^ 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348:in `require_or_load' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in `depend_on' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214:in `require_dependency' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in `each' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in `block in eager_load!' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in `each' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in `eager_load!' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application/finisher.rb:51:in `block in &lt;module:Finisher&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/config/environment.rb:5:in `&lt;top (required)&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/config.ru:4:in `block in &lt;main&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/config.ru:1:in `new' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/config.ru:1:in `&lt;main&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:200:in `app' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:46:in `app' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:252:in `start' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:54:in `block in &lt;top (required)&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in `&lt;top (required)&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from script/rails:6:in `require' 2012-01-09T21:31:36+00:00 app[web.1]: from script/rails:6:in `&lt;main&gt;' 2012-01-09T21:31:36+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start' 2012-01-09T21:31:37+00:00 heroku[web.1]: State changed from starting to crashed 2012-01-09T21:31:38+00:00 heroku[web.1]: Process exited 2012-01-09T21:41:11+00:00 heroku[web.1]: State changed from crashed to created 2012-01-09T21:41:11+00:00 heroku[web.1]: State changed from created to starting 2012-01-09T21:41:23+00:00 heroku[web.1]: State changed from starting to crashed </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload