I'm deploying an app (using Capistrano) to a staging server prior to
final deployment.  The app runs fine in dev, but in staging it throws a
syntax error. How can that be?

The error is:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require':
/Library/WebServer/staging.givetothem.co.uk/releases/20091023133654/app/controllers/bulkimport_controller.rb:32:
syntax error, unexpected kRESCUE, expecting kEND (SyntaxError)
      rescue Exception
            ^

The code generating the error is:

      begin
        @parsed_file=CSV::Reader.parse(params[:dump][:file])
        n=0
        @parsed_file.each do |row|
        unless row[0].nil?
          [email protected]
          c.address=row[0]
          if c.save
            n=n+1
            GC.start if n%50==0
          end
        end
      rescue Exception
        flash.now[:error]="Import failed! Please check the file and try
again."
      else
        flash.now[:notice]="Import successful,  #{n} new addresses added
to your list."
      end

Another couple errors are then thrown: two lines further complaining
about the else, then at EOF still expecting kEND.

I can't see it, and textmate suggests I've all my starts and ends lined
up. What am I doing wrong? And more importantly, does anyone have any
idea why is is showing in staging only and not in my dev environment?

Rails is 2.3.4 on both, Ruby is 1.8.7pl72, gems are frozen in, OSes is
OSX Snow Leopard & Snow Leopard server.

Thanks in advance for any help - I'm a relative newb at this.

Alan.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to