bpot / data_fabric

Sharding and replication support for ActiveRecord
http://github.com/mperham/data_fabric
76 stars 11 forks source link

data_fabric 1.3.3 not working with rails 3.1.1 #4

Open vishakhasawant opened 12 years ago

vishakhasawant commented 12 years ago

I tried to use data_fabric with rails 3.1.1 but getting error as.... uninitialized constant DataFabric::ConnectionProxy::RAILS_ENV. While the data_fabric development i.e. https://github.com/bpot/data_fabric.git. is working with rails 3.1.1. But It gives error while executing create statements from the migration file.

bpot commented 12 years ago

Yup, the RAILS_ENV issue is fixed on master. I hope to push a new version of the gem this week with that fix and 3.2 support. What errors are you seeing from the migration?

vishakhasawant commented 12 years ago

Hi bpot,

Thanks for the reply. Below is the error stack-trace I am getting while trying to run migration with model.create statements.

e.g. class User < ActiveRecord::Migration def change create_table :user do |t| t.string :name t.string :email t.string :address
end

data

User.create(:name => 'firstname', :email => 'test@test.com', :address => 'uk')
end

end

PGError: ERROR: relation "permissions" does not exist LINE 4: WHERE a.attrelid = '"permissions"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"permissions"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1003:in async_exec' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1003:inexec_no_cache' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:591:in block in exec_query' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:244:inblock in log' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:239:inlog' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:590:in exec_query' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1102:incolumn_definitions' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:781:in columns' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:inblock (2 levels) in initialize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in with_connection' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:92:inblock in initialize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:112:in yield' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:112:indefault' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:112:in block in initialize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:723:inyield' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:723:in default' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:723:incolumn_defaults' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/persistence.rb:327:in attributes_from_column_definition' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/locking/optimistic.rb:69:inattributes_from_column_definition' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:1550:in initialize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:508:innew' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:508:in create' /mnt/hgfs/nusdigital/db/migrate/20111219113023_create_permissions.rb:12:inchange' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:391:in block (2 levels) in migrate' /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:295:inmeasure' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:391:in block in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:inwith_connection' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:375:in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:507:inmigrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:687:in block (2 levels) in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:742:incall' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:742:in block in ddl_transaction' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:192:intransaction' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/transactions.rb:208:in transaction' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:742:inddl_transaction' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:686:in block in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:671:ineach' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:671:in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:549:inup' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/migration.rb:530:in migrate' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/railties/databases.rake:161:inblock (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:inblock in invoke_prerequisites' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in each' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:ininvoke_prerequisites' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>' /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake:19:in load' /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake:19:in

' Tasks: TOP => db:migrate:reset => db:migrate

Regards,

Vishakha