error when installing

369 views
Skip to first unread message

jamie green

unread,
Aug 15, 2016, 4:15:06 PM8/15/16
to opensport
Hi,

Im new to Ruby.

i recieve the error: index name 'index_taggings_on_tag_id' on table 'taggings' already exists

when i run the command: sportdb new en 

This problem has been repeated on two machines

please can you help me fix the problem?

Specs: windows 8 Ruby 2.25 64 bit from rubyinstaller.org

(if i run with ruby 2.3.1 i recieve the error 

Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile.
(copied from a similar error on stack exchange)

indeed when the command gem install sportdb is run with 2.3.1 the first line of output does not reference sqlite3 unlike 2.2.5) 

thank you

jamie 


Gerald Bauer

unread,
Aug 15, 2016, 4:20:11 PM8/15/16
to open...@googlegroups.com
Hello,
Thanks for trying the football.db.

Try:

$ sportdb create

to double check that your setup is ok. The create command will
create an empty database with all tables (and indexes) in your working
folder. Do you get the same error?

Cheers.

Hilda Merom

unread,
Aug 23, 2016, 6:39:32 AM8/23/16
to opensport
Facing the same problem
My environment

ruby 2.2.4p230

sportdb 1.11.0


activerecord-utils/0.4.0 (activerecord/5.0.0) on Ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::Country<
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::StateBase<
 
[TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::CityBase<
sportdb
-update/0.1.1 on Ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
sportdb
-service/0.4.0 on Ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
sportdb
/1.11.0 on Ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
sportdb
/1.11.0 on Ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
working directory
: /Documents/Football
Connecting to db using settings:
{:adapter=>"sqlite3", :database=>"./sport.db"}
-- create_table(:logs)
   
-> 0.0083s
-- create_table(:props, {})
   
-> 0.0006s
-- create_table(:tags)
   
-> 0.0010s
-- add_index(:tags, :key, {:unique=>true})
   
-> 0.0007s
-- create_table(:taggings)
   
-> 0.0013s
-- add_index(:taggings, :tag_id)

*** error: Index name 'index_taggings_on_tag_id' on table 'taggings' already exists


Gerald Bauer

unread,
Aug 23, 2016, 6:47:04 AM8/23/16
to open...@googlegroups.com
Hello,
Thanks for reporting and the detailed log. Now I see the problem/issue:

> activerecord/5.0.0

Starting with ActiveRecord 5.0.0 I think the database library will
auto-create indexes on foreign key references, thus, the duplicate
e.g. first the index gets auto-created (new in 5.0.0) and, than,
sportdb tries to create the index again itself (and will fail/crash).

Will have to read-up on ActiveRecord 5.0.0.and send out an update.
However, this will take some weeks.

As a work around for now, please downgrade ActiveRecord to the 4.x
series (e.g. 4.2.x is the latest) by using a Gemfile and everything
will work ase advertised. Let us know how it goes. Cheers.

Chris Wendel

unread,
Sep 5, 2016, 7:22:12 AM9/5/16
to opensport
I uninstalled activerecord and installed active record 4.7.2.1 and I am still seeing the same issue on sportdb create?

Gerald Bauer

unread,
Sep 5, 2016, 7:26:13 AM9/5/16
to open...@googlegroups.com
Hello,

Thanks for trying sport.db / football.db.

> active record 4.7.2.1

The 4.7.2.1 version doesn't exit - I assume 4.3.2.1 (that latest
before the 5.x series)

Anyways, sorry hard to tell without seeing any logs etc.

I'd suggest using a Gemfile and than bundle exec spordb ... etc.
to make sure you have all version locked down. Good luck. Cheers.

Hilda Merom

unread,
Sep 12, 2016, 6:41:38 AM9/12/16
to opensport
Thank, Work like a charm!
BTW best practice is using a Gemfile and add this to it
gem "activerecord", "= 4.2.7.1"

Gerald Bauer

unread,
Sep 12, 2016, 8:46:28 AM9/12/16
to open...@googlegroups.com
Hello,

> Work like a charm!
> BTW best practice is using a Gemfile and add this to it
> gem "activerecord", "= 4.2.7.1"

Thanks for the update and best practice recommendation. Good to hear
it's working.

Cheers.

Akalanka Galappaththi

unread,
Oct 18, 2016, 3:31:42 AM10/18/16
to opensport
In which gem file should I change the activerecord version number...

Gerald Bauer

unread,
Oct 18, 2016, 3:36:52 AM10/18/16
to open...@googlegroups.com
Hello,

Welcome to football.db. You have to add a *new* Gemfile in your
working folder / directory, see the bundler docu [1] for details on
how to use Gemfiles and lock down your versions. Good luck. Cheers.

[1] http://bundler.io
Reply all
Reply to author
Forward
0 new messages