Savepoints being used on old versions of SQLite #5885

Closed
mconigliaro opened this Issue Apr 17, 2012 · 33 comments

Comments

Projects
None yet

We're using an old version of SQLite on CentOS 5 in which savepoints are not supported:

$ sqlite3 -version 
3.3.6

And it looks like ActiveRecord has code to check whether savepoints are supported on the current version of SQLite (i.e. the supports_savepoints? method):

https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb#L98-101

However, we are still seeing tons of these failure messages in our tests:

ActiveRecord::StatementInvalid:
   SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1

So why are savepoints being used anyway?

For what it's worth (I don't know if this actually means anything), I grepped the rails source for "supports_savepoints," and I couldn't find where this method was being used (except in tests):

$ grep -r supports_savepoints ./
./activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:      def supports_savepoints?
./activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:      def supports_savepoints?
./activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:      def supports_savepoints?
./activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:      def supports_savepoints?
./activerecord/test/cases/associations/has_one_associations_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/associations/join_model_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/autosave_association_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/helper.rb:def supports_savepoints?
./activerecord/test/cases/helper.rb:  ActiveRecord::Base.connection.supports_savepoints?
./activerecord/test/cases/nested_attributes_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/nested_attributes_test.rb:  self.use_transactional_fixtures = false unless supports_savepoints?
./activerecord/test/cases/transactions_test.rb:  end if Topic.connection.supports_savepoints?
./activerecord/test/cases/transactions_test.rb:  end if Topic.connection.supports_savepoints?
./activerecord/test/cases/transactions_test.rb:  end if Topic.connection.supports_savepoints?
./activerecord/test/cases/transactions_test.rb:  end if Topic.connection.supports_savepoints?
./activerecord/test/cases/transactions_test.rb:end if Topic.connection.supports_savepoints?

relf commented Apr 27, 2012

Same issue for me. I use rails 3.1.3, rspec2.9, factory_girl 3.2 and sqlite 3.3.6.
The error occurs for each fixture creation : FactoryGirl.create or build

I'm having the same issue using sqlite3 version 3.7.7. Has any progress been made on this?

Here's my related question on Stack Overflow: http://stackoverflow.com/questions/10406503/rspec-test-fails-with-sqlexception

relf commented May 3, 2012

I have installed sqlite 3.7.2, it works fine now (I forgot to specify I am also on CentOS 5.5 hence initially sqlite 3.3.6).

I was showing version 3.7.7 the day I wrote my previous comment, but went to take another look last night and I was using 3.5.4. Updated to 3.7.10 and the issue was resolved.

Yeah, that's because savepoints are supported as of version 3.6.8 of SQLite. The problem will still exist for anyone who happens to be stuck on an older version.

I'm a little baffled at why I was seeing 3.7.7, but happy just to see all my test passing

I have install sqlite 3.7.12 but the problem still exists any suggestions

I have got sorted let me post it here it might help someone.

  1. Dowload sqlite3
  2. unzip it
  3. run ./configure --prefix=/usr
  4. run make
  5. make install
  6. source ~/.bash_profile or exec $SHELL
    you good to go

hmm, my problem is that if I install the sqlite from source, Istill have to keep the yum version (because yum depends on it).
so my symbols files are getting mixed up and it doesnt work :(

did you try updating with yum?

Yes, but no help. Still the same error.

can you send you errors please? I mean stack dump

Member

steveklabnik commented Sep 16, 2012

Sqlite 3.6.8 was released on 2009 Jan 12. Just upgrade your sqlite3 and this isn't an issue.

steve you might wanna look the comment I posted above that exactly what I said

Member

drogus commented Sep 16, 2012

@alirz23 this issue is quite old anyway, I would keep it closed, unless someone is able to reproduce it in clean rails application (or write failing test in rails test suite).

Member

steveklabnik commented Sep 16, 2012

Yep. If we can demonstrate that this is working with a clean rails and a modern distro (centos 5 isn't even the current version of the os...) then we could re-open.

@alirz23 your comments are good! We're in agreement. No answer to your question in four months means we can't help.

I'm on OSX 10.5.8, rails 3.2.8 (via rvm), just upgraded to sqlite3 3.7.14 via macports:

$ sqlite3 --version
3.7.14 2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a

And...

$ cucumber
...normal cucumber output
SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1 (ActiveRecord::StatementInvalid)
(eval):2:in `click_button'
...more cucmber output

Hmmmm - the problem still persists

Tried reinstalling the sqlite3 gem - no luck.

Member

drogus commented Sep 18, 2012

@doctorpod could you provide steps to reproduce it on bare rails app?

Member

steveklabnik commented Sep 18, 2012

On my machine:

$ sqlite3 --version
3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af

@drogus Here's how to reproduce:

$ rvm use 1.9.3
Using /Users/andywhite/.rvm/gems/ruby-1.9.3-p194
Running /Users/andywhite/.rvm/hooks/after_use
$ rails new foo
      create  README.rdoc
      create  Rakefile
      (snip)
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 
(snip)
Using uglifier (1.3.0) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$ cd foo
$ rails g model bar name
      invoke  active_record
      create    db/migrate/20120918111540_create_bars.rb
      create    app/models/bar.rb
      invoke    test_unit
      create      test/unit/bar_test.rb
      create      test/fixtures/bars.yml
$ rake db:migrate
==  CreateBars: migrating =====================================================
-- create_table(:bars)
   -> 0.0014s
==  CreateBars: migrated (0.0017s) ============================================

$ rake db:setup RAILS_ENV=test
db/test.sqlite3 already exists
-- create_table("bars", {:force=>true})
   -> 0.0118s
-- initialize_schema_migrations_table()
   -> 0.0056s
-- assume_migrated_upto_version(20120918111540, ["/Users/andywhite/Development/foo/db/migrate"])
   -> 0.0032s
$ rake test:units
Run options: 

    # Running tests:

E

Finished tests in 0.090871s, 11.0046 tests/s, 0.0000 assertions/s.

  1) Error:
test_the_truth(BarTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `initialize'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `new'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `prepare'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:134:in `execute'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:302:in `create_savepoint'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:186:in `transaction'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:241:in `block in save'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:240:in `save'
    /Users/andywhite/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/persistence.rb:45:in `create'
    /Users/andywhite/Development/foo/test/unit/bar_test.rb:5:in `block in <class:BarTest>'

1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1): [/Users/andywhite/.rvm/rubies/ruby-1.9.3-p1...]

Tasks: TOP => test:units
(See full trace by running task with --trace)

Bingo!

Here's test/unit/bar_test.rb:

require 'test_helper'

class BarTest < ActiveSupport::TestCase
  test "the truth" do
    assert Bar.create(:name => 'Fred')
  end
end

@doctorpod prefix it to --prefix=/usr should solve your problem

Member

steveklabnik commented Sep 18, 2012

On my machine:

$ rails new issue_5885
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      (snip)
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 
Using i18n (0.6.1) 
Using multi_json (1.3.6) 
Using activesupport (3.2.8) 
(snip)
Using sqlite3 (1.3.6) 
Using uglifier (1.3.0) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
steve at thoth in ~/tmp
$ cd issue_5885 

steve at thoth in ~/tmp/issue_5885
$ rails g model bar name
      invoke  active_record
      create    db/migrate/20120918115302_create_bars.rb
      create    app/models/bar.rb
      invoke    test_unit
      create      test/unit/bar_test.rb
      create      test/fixtures/bars.yml

steve at thoth in ~/tmp/issue_5885
$ rake db:migrate
==  CreateBars: migrating =====================================================
-- create_table(:bars)
   -> 0.0010s
==  CreateBars: migrated (0.0011s) ============================================


steve at thoth in ~/tmp/issue_5885
$ rake db:setup RAILS_ENV=test
-- create_table("bars", {:force=>true})
   -> 0.0076s
-- initialize_schema_migrations_table()
   -> 0.0033s
-- assume_migrated_upto_version(20120918115302, ["/Users/steve/tmp/issue_5885/db/migrate"])
   -> 0.0017s

steve at thoth in ~/tmp/issue_5885
$ cat > test/unit/bar_test.rb 
require 'test_helper'

class BarTest < ActiveSupport::TestCase
  test "the truth" do
    assert Bar.create(:name => 'Fred')
  end
end
^D

$ rake test:units
Run options: 

# Running tests:

.

Finished tests in 0.059423s, 16.8285 tests/s, 16.8285 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

@steveklabnik Don't you just love it when you can't reproduce a bug ;) So what's different between my env and yours?

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.5.8
BuildVersion:   9L31a
$ rvm --version

rvm 1.15.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

$ rvm list

rvm rubies

 * ruby-1.8.7-p370 [ i686 ]
=> ruby-1.9.3-p194 [ i386 ]

# => - current
# =* - current && default
#  * - default

$ rails -v
Rails 3.2.8
$ gem list

*** LOCAL GEMS ***

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
addressable (2.3.2)
arel (3.0.2)
bcrypt-ruby (3.0.1)
builder (3.0.3, 3.0.2)
bundler (1.2.0)
capybara (1.1.2)
childprocess (0.3.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
cucumber (1.0.6)
cucumber-rails (1.0.6)
daemon_controller (1.0.0)
database_cleaner (0.8.0)
devise (2.1.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
fastthread (1.0.7)
ffi (1.1.5)
gherkin (2.4.21)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.2)
json (1.7.5)
json_pure (1.7.5)
launchy (2.1.2)
libwebsocket (0.1.5)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
nokogiri (1.5.5)
orm_adapter (0.4.0)
passenger (3.0.17)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
rspec-mocks (2.11.2)
rspec-rails (2.11.0)
rubygems-bundler (1.0.7)
rubyzip (0.9.9)
rvm (1.11.3.5)
sass (3.2.1)
sass-rails (3.2.5)
selenium-webdriver (2.25.0)
spork (0.9.2)
sprockets (2.1.3)
sqlite3 (1.3.6)
term-ansicolor (1.0.7)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.3.0)
warden (1.2.1)
xpath (0.1.4)
$ sqlite3 --version
3.7.14 2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a
Member

steveklabnik commented Sep 18, 2012

Heh. I know, right? :(

Here's mine, for comparison:

steve at thoth in ~/tmp/issue_5885
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.8.1
BuildVersion:   12B19

steve at thoth in ~/tmp/issue_5885
$  rvm --version

rvm 1.14.12 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]


steve at thoth in ~/tmp/issue_5885
$ rvm list

rvm rubies

   /Users/steve/.rvm/scripts/list: line 294: /Users/steve/.rvm/rubies/jruby-1.6.7.2/config: No such file or directory
jruby-1.6.7.2 [  ]
=* ruby-1.9.3-p194 [ x86_64 ]

# => - current
# =* - current && default
#  * - default


steve at thoth in ~/tmp/issue_5885
$ rails -v
Rails 3.2.8

steve at thoth in ~/tmp/issue_5885
$ bundle list
Gems included by the bundle:
  * actionmailer (3.2.8)
  * actionpack (3.2.8)
  * activemodel (3.2.8)
  * activerecord (3.2.8)
  * activeresource (3.2.8)
  * activesupport (3.2.8)
  * arel (3.0.2)
  * builder (3.0.3)
  * bundler (1.2.0)
  * coffee-rails (3.2.2)
  * coffee-script (2.2.0)
  * coffee-script-source (1.3.3)
  * erubis (2.7.0)
  * execjs (1.4.0)
  * hike (1.2.1)
  * i18n (0.6.1)
  * journey (1.0.4)
  * jquery-rails (2.1.2)
  * json (1.7.5)
  * mail (2.4.4)
  * mime-types (1.19)
  * multi_json (1.3.6)
  * polyglot (0.3.3)
  * rack (1.4.1)
  * rack-cache (1.2)
  * rack-ssl (1.3.2)
  * rack-test (0.6.1)
  * rails (3.2.8)
  * railties (3.2.8)
  * rake (0.9.2.2)
  * rdoc (3.12)
  * sass (3.2.1)
  * sass-rails (3.2.5)
  * sprockets (2.1.3)
  * sqlite3 (1.3.6)
  * thor (0.16.0)
  * tilt (1.3.3)
  * treetop (1.4.10)
  * tzinfo (0.3.33)
  * uglifier (1.3.0)

steve at thoth in ~/tmp/issue_5885
$ sqlite3 --version
3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af

Member

steveklabnik commented Sep 18, 2012

Looks like the only thing that's older with yours is the OS...

Might try reproducing the problem on my other Mac which is running Snow Leopard. Watch this space...

Same problem here (savepoint error running rake test after building a default scaffold model), I am also on an old macOS version. My environment is:

bash-3.2$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.5.8
BuildVersion:   9L31a
bash-3.2$ rvm --version

rvm 1.15.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

bash-3.2$ rvm list

rvm rubies

   jruby-1.6.7.2 [ x86_64 ]
   ruby-1.8.7-p370 [ i686 ]
=* ruby-1.9.3-p194 [ i386 ]

# => - current
# =* - current && default
#  * - default

bash-3.2$ rails -v
Rails 3.2.8
bash-3.2$ bundle list
Gems included by the bundle:
  * actionmailer (3.2.8)
  * actionpack (3.2.8)
  * activemodel (3.2.8)
  * activerecord (3.2.8)
  * activeresource (3.2.8)
  * activesupport (3.2.8)
  * arel (3.0.2)
  * builder (3.0.3)
  * bundler (1.2.0)
  * coffee-rails (3.2.2)
  * coffee-script (2.2.0)
  * coffee-script-source (1.3.3)
  * erubis (2.7.0)
  * execjs (1.4.0)
  * hike (1.2.1)
  * i18n (0.6.1)
  * journey (1.0.4)
  * jquery-rails (2.1.2)
  * json (1.7.5)
  * mail (2.4.4)
  * mime-types (1.19)
  * multi_json (1.3.6)
  * polyglot (0.3.3)
  * rack (1.4.1)
  * rack-cache (1.2)
  * rack-ssl (1.3.2)
  * rack-test (0.6.1)
  * rails (3.2.8)
  * railties (3.2.8)
  * rake (0.9.2.2)
  * rdoc (3.12)
  * sass (3.2.1)
  * sass-rails (3.2.5)
  * sprockets (2.1.3)
  * sqlite3 (1.3.6)
  * thor (0.16.0)
  * tilt (1.3.3)
  * treetop (1.4.10)
  * tzinfo (0.3.33)
  * uglifier (1.3.0)

bash-3.2$ sqlite3 --version
3.7.14 2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a

My gut feel is that the sqlite3 gem is using the original version of sqlite3 installed on my machine at /usr/bin/sqlite3, rather than the later version installed via ports at /opt/local/bin/sqlite3. The temporary workaround for me is to use MySQL (just edit the config/database.yaml file accordingly) - which works but is annoying:

$ which sqlite3
/opt/local/bin/sqlite3
$ /opt/local/bin/sqlite3 --version
3.7.14 2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a
$ /usr/bin/sqlite3 --version
3.4.0
$ cat config/database.yml 
# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: foo_test
  pool: 5
  username: foo
  password: bar
  socket: /tmp/mysql.sock

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000
$
rake test:units
Run options: 

# Running tests:

.

Finished tests in 0.199300s, 5.0176 tests/s, 5.0176 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
$

A likely fix would be to update to the latest sqlite3 to it's normal system location (which I think @alirz23 alluded to) but I think I'm going to bite the bullet in a week or two, upgrade to Leopard and switch to homebrew - see if that fixes it.

That sounded like a good theory, but removing the old sqlite3 from /usr/bin (so the only sqlite3 binary around is the 3.7.14 I installed with homebrew) didn't fix the problem, I still get the same error:

bash-3.2$ bundle exec rake  test 
Run options: 

# Running tests:



Finished tests in 0.004238s, 0.0000 tests/s, 0.0000 assertions/s.

0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Run options: 

# Running tests:

EE....E

Finished tests in 0.257729s, 27.1603 tests/s, 19.4002 assertions/s.

  1) Error:
test_should_create_product(ProductsControllerTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `initialize'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `new'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `prepare'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:134:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:302:in `create_savepoint'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:186:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:241:in `block in save'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:240:in `save'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/app/controllers/products_controller.rb:46:in `block in create'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `call'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `retrieve_collector_from_mimes'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:194:in `respond_to'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/app/controllers/products_controller.rb:45:in `create'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__524473338__process_action__744349811__callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:469:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:49:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:391:in `post'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/test/functional/products_controller_test.rb:21:in `block (2 levels) in <class:ProductsControllerTest>'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/assertions.rb:55:in `assert_difference'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/test/functional/products_controller_test.rb:20:in `block in <class:ProductsControllerTest>'

  2) Error:
test_should_destroy_product(ProductsControllerTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `initialize'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `new'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `prepare'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:134:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:302:in `create_savepoint'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:186:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:236:in `destroy'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/app/controllers/products_controller.rb:76:in `destroy'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__524473338__process_action__332130605__callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:469:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:49:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:401:in `delete'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/test/functional/products_controller_test.rb:44:in `block (2 levels) in <class:ProductsControllerTest>'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/assertions.rb:55:in `assert_difference'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/test/functional/products_controller_test.rb:43:in `block in <class:ProductsControllerTest>'

  3) Error:
test_should_update_product(ProductsControllerTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `initialize'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `new'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `prepare'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:134:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:302:in `create_savepoint'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:186:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/persistence.rb:214:in `update_attributes'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/app/controllers/products_controller.rb:62:in `block in update'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `call'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:270:in `retrieve_collector_from_mimes'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:194:in `respond_to'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/app/controllers/products_controller.rb:61:in `update'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__524473338__process_action__255306983__callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:469:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:49:in `process'
    /Users/raquel/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_controller/test_case.rb:396:in `put'
    /Users/raquel/Desktop/javier/workspace/ruby/demo/test/functional/products_controller_test.rb:38:in `block in <class:ProductsControllerTest>'

7 tests, 5 assertions, 0 failures, 3 errors, 0 skips
Errors running test:functionals! #<RuntimeError: Command failed with status (3): [/Users/raquel/.rvm/rubies/ruby-1.9.3-p194/...]>

@javiervegas install it in /usr/bin that should fix it

I tried that, copied the new sqlite3 there

$ /usr/bin/sqlite3 --version
3.7.14 2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a

but still get the error when running tests

Contributor

duffyjp commented Nov 16, 2015

Still happening in 2015:

Component Version
rails Rails 4.2.4
ruby 2.2.3p173 (2015-08-18 revision 51636) [powerpc-darwin9.0]
OS Mac OS X 10.5.8 9L31a
sqlite3 3.8.11.1 2015-07-29 20:00:57 cf538e2783e468bbc25e7cb2a9ee64d3e0e80b2f
sqlite3 gem 1.3.11
$ rails new issue_5885
$ bundle list
Gems included by the bundle:
  * actionmailer (4.2.4)
  * actionpack (4.2.4)
  * actionview (4.2.4)
  * activejob (4.2.4)
  * activemodel (4.2.4)
  * activerecord (4.2.4)
  * activesupport (4.2.4)
  * arel (6.0.3)
  * binding_of_caller (0.7.2)
  * builder (3.2.2)
  * bundler (1.10.6)
  * byebug (8.2.0)
  * coffee-rails (4.1.0)
  * coffee-script (2.4.1)
  * coffee-script-source (1.10.0)
  * debug_inspector (0.0.2)
  * erubis (2.7.0)
  * execjs (2.6.0)
  * globalid (0.3.6)
  * i18n (0.7.0)
  * jbuilder (2.3.2)
  * jquery-rails (4.0.5)
  * json (1.8.3)
  * loofah (2.0.3)
  * mail (2.6.3)
  * mime-types (2.6.2)
  * mini_portile (0.6.2)
  * minitest (5.8.2)
  * multi_json (1.11.2)
  * nokogiri (1.6.6.2)
  * rack (1.6.4)
  * rack-test (0.6.3)
  * rails (4.2.4)
  * rails-deprecated_sanitizer (1.0.3)
  * rails-dom-testing (1.0.7)
  * rails-html-sanitizer (1.0.2)
  * railties (4.2.4)
  * rake (10.4.2)
  * rdoc (4.2.0)
  * sass (3.4.19)
  * sass-rails (5.0.4)
  * sdoc (0.4.1)
  * spring (1.4.1)
  * sprockets (3.4.0)
  * sprockets-rails (2.3.3)
  * sqlite3 (1.3.11)
  * thor (0.19.1)
  * thread_safe (0.3.5)
  * tilt (2.0.1)
  * turbolinks (2.5.3)
  * tzinfo (1.2.2)
  * uglifier (2.7.2)
  * web-console (2.2.1)
$ rails g model bar name
$ rake db:migrate

Edit test/models/bar_test.rb

require 'test_helper'
class BarTest < ActiveSupport::TestCase
   test "the truth" do
     assert Bar.create(name: 'Fred')
   end
end
$ rake test:units
Finished in 1.536349s, 0.6509 runs/s, 0.0000 assertions/s.

  1) Error:
BarTest#test_the_truth:
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
    test/models/bar_test.rb:5:in `block in <class:BarTest>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
Member

arthurnn commented Nov 28, 2015

@duffyjp can you open a new issue and reference this one?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment