Open vishakhasawant opened 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?
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
User.create(:name => 'firstname', :email => 'test@test.com', :address => 'uk')
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:in
exec_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:in
block 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:in
log'
/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:in
column_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:in
block (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:in
block 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:in
default'
/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:in
yield'
/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:in
column_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:in
attributes_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:in
new'
/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:in
change'
/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:in
measure'
/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:in
with_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:in
migrate'
/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:in
call'
/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:in
transaction'
/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:in
ddl_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:in
each'
/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:in
up'
/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:in
block (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:in
block 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:in
execute'
/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:in
mon_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:in
block 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:in
invoke_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:in
mon_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:in
invoke'
/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:in
block (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:in
block 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:in
top_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:in
standard_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
Regards,
Vishakha
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.