Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4625970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:21:00+00:00 2026-05-22T03:21:00+00:00

I am creating a rails application with geographical locations using spatial_adapter and GeoRuby. When

  • 0

I am creating a rails application with geographical locations using spatial_adapter and GeoRuby. When running the actual application in development mode, everything works fine, but when trying to use YAML fixtures, I get a MySQL syntax error. I am using the following fixture:

one:
  name: Event One
  starts_at: 2011-04-20 12:00:00
  ends_at: 2011-04-20 16:00:00
  topics:
    - topic1
    - topic2
  pos: !ruby/object:Point
    x: 10
    y: 10

Running this, either with Test::Ruby or RSpec gives the following error:

ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '), '2011-05-05 20:57:34', '2011-05-05 20:57:34', 908014535)'
at line 1: INSERT INTO `events` (`name`, `starts_at`, `ends_at`, `pos`, `created_at`, `updated_at`, `id`) VALUES ('Lindy Jam', '2011-04-20 12:00:00', '2011-04-20 16:00:00', GeomFromWKB(0x010100000000000000000024400000000000002440,), '2011-05-05 20:57:34', '2011-05-05 20:57:34', 908014535)

The key seems to be at this point:

GeomFromWKB(0x010100000000000000000024400000000000002440,),

With an extra comma inside the parenthesis. I don’t know where this is coming from, but it is working for regular insertions in the development-mode app.

The stack trace is:

/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'
/var/lib/gems/1.9.1/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:314:in `execute'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/database_statements.rb:239:in `insert_fixture'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:646:in `block in insert_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:582:in `each'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:582:in `insert_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:526:in `block (4 levels) in create_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:526:in `each'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:526:in `block (3 levels) in create_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:524:in `block (2 levels) in create_fixtures'
/var/lib/gems/1.9.1/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:232:in `disable_referential_integrity'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:515:in `block in create_fixtures'
/var/lib/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/benchmarkable.rb:55:in `silence'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:514:in `create_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:973:in `load_fixtures'
/var/lib/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/fixtures.rb:938:in `setup_fixtures'
/var/lib/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:425:in `_run_setup_callbacks'
/var/lib/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

I am running rails 3.0.7 with Ruby 1.9.2 on Ubuntu 11.04.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:21:01+00:00Added an answer on May 22, 2026 at 3:21 am

    Turns out it’s an error in spatial_adapter. It expects there to be an srid attribute on the geometry objects, but for some reason one isn’t set when the fixtures create a GeoRuby object.

    A temporary workaround is to manually add an srid attribute in the YAML file like this:

    one:
      name: Event One
      starts_at: 2011-04-20 12:00:00
      ends_at: 2011-04-20 16:00:00
      topics:
        - topic1
        - topic2
      pos: !ruby/object:Point
        srid: -1
        x: 10
        y: 10
    

    Where -1 is just a placeholder for “unspecified srid”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just begun creating a rails application using mongomapper for my models. I'm wondering
I am using open flash chart 2 (the plugin) in my rails application. Everything
I'm creating a Rails application, and I've hit a bit of a snag. I
I'm creating a fast application with ruby on rails, and after doing a lot
I'm working creating rails application and wondered where I can find good tutorials on
I'm creating rails application where it allow users to add geo-location data for restaurants,
I am creating a rails application that needs to store a large amount of
We are creating a rails application for an already existing database. We need to
I'm creating a Rails application which uses MySQL. I have a table in my
I want to automate things like: Creating a new Ruby on Rails application with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.