SyntaxError in Windows 7 environment

16 views
Skip to first unread message

Rob Daniels

unread,
Jun 4, 2013, 4:31:31 PM6/4/13
to activem...@googlegroups.com
I'm getting an error that I have no clue how to fix when trying to execute the ReadMe sample usage with my credentials subbed in. I'm running Rails v.3.2.12 and Ruby 1.9.3p392 on a Windows 7 PC. Here is the error I'm receiving:


SyntaxError in CheckoutController#ship_options

D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/rexml/functions.rb:302: syntax error, unexpected '.', expecting ';' or '\n'
        config.action_controller.perform_caching = falsefalse(  )
               ^
D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/rexml/functions.rb:395: syntax error, unexpected keyword_end, expecting $end

Rails.root: D:/webroot/lincoln_rails

Application Trace | Framework Trace | Full Trace
app/controllers/checkout_controller.rb:99:in `ship_options'
This error occurred while loading the following files:
   rexml/document
   rexml/element
   rexml/xpath
   rexml/functions

I've tried with both UPS and FedEx with the same Syntax Error response (it bombs on the response = fedex.find_rates line). Here is my call from the controller:

 # Package up a poster and a Wii for your nephew.
    packages = [
        Package.new(
            100,                        # 100 grams
            [93,10],                    # 93 cm long, 10 cm diameter
            :cylinder => true),         # cylinders have different volume calculations

        Package.new(
            (7.5 * 16),     # 7.5 lbs, times 16 oz/lb.
            [15, 10, 4.5],              # 15x10x4.5 inches
            :units => :imperial
        )        # not grams, not centimetres
    ]

    origin = Location.new(
        :country => 'US',
        :state => 'CA',
        :city => 'Beverly Hills',
        :zip => '90210'
    )

    destination = Location.new(
        :country => 'CA',
        :province => 'ON',
        :city => 'Ottawa',
        :postal_code => 'K1P 1J1'
    )

    fedex = FedEx.new(:login => 'xxx', :password => 'xxx', :key => 'xxx', :account => 'xxx', :meter => 'xxx', :test => true)
    response = fedex.find_rates(origin, destination, packages)

Rob Daniels

unread,
Jun 5, 2013, 2:09:49 PM6/5/13
to activem...@googlegroups.com
I found the solution, it's with the core rails code - a bit sketchy for me to edit (i'm still pretty new at ruby & rails).
On the file D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/rexml/functions.rb line 302 was:

config.action_controller.perform_caching = falsefalse(  )

i changed it to 
config.action_controller.perform_caching = false
Reply all
Reply to author
Forward
0 new messages