|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
Problems with setup Globalize and Postgresql databaseOS: CentOS 4.5
Ruby 1.8.5 Rails 1.2.3 Postgresql-server 8.1.9 Globalize/for-1.2 When running "rake globalize:setup" I get this error: ---> $ rake globalize:setup --trace (in /home/byrnejb/software/theheart) ** Invoke globalize:setup (first_time) ** Invoke globalize:create_tables (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! PGError: ERROR: relation "globalize_languages" does not exist : 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 = 'globalize_languages'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:142:in `query' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:528:in `column_definitions' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in `columns' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:763:in `columns_without_redhillonrails_core' /home/byrnejb/software/theheart/config/../vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/base.rb:25:in `columns' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:776:in `column_names' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:789:in `column_methods_hash' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1262:in `all_attributes_exists?' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:250:in `all?' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1262:in `each' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1262:in `all?' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1262:in `all_attributes_exists?' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1196:in `method_missing' /home/byrnejb/software/theheart/config/../vendor/plugins/globalize/lib/globalize/models/language.rb:37:in `pick' /home/byrnejb/software/theheart/config/../vendor/plugins/globalize/lib/globalize/localization/locale.rb:124:in `initialize' /home/byrnejb/software/theheart/config/../vendor/plugins/globalize/lib/globalize/localization/locale.rb:39:in `new' /home/byrnejb/software/theheart/config/../vendor/plugins/globalize/lib/globalize/localization/locale.rb:39:in `set' /home/byrnejb/software/theheart/config/../config/environment.rb:73 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/misc.rake:3 /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in `invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `send' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in `invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in `invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `send' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in `invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 <--- I cannot see anything obviously wrong with my config: config/environment.rb ---> # Support for globalize plugin see: # http://www.globalize-rails.org/globalize/ $KCODE = 'u' require 'jcode' #Globalize::Locale.set_base_language 'en-CA' #Globalize::Locale.set 'en-US' include Globalize Locale.set_base_language 'en-CA' Locale.set 'en-US' <--- Can someone point out what I am doing wrong? -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@... Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 |
|
|
|
|
|
Re: Problems with setup Globalize and Postgresql databaseHi James,
I am also working with Globalize and have successfully integrated and deployed it on Linux / OS X and Solaris, however, on Windows I have had also problems, similar to those you have experienced. We are using MySQL, that could also be an issue. Neither this list nor the documentation did give me any clues as to which OSs are supported or how we could resolve OS specific problems. Has work entirely stalled on Globalize? Greetings, Juergen On 09.07.2007, at 17:15, James B. Byrne wrote: > > I seem to gotten past the setup problem by running "rake > globalize:create_tables" followed by "rake globalize:load_locale_data" > > However, now when I try to start my site (script/server) I get this > error: > > ---> > $ script/server > => Booting WEBrick... > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `remove_const': cannot remove Object::ViewTranslation (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `send' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `remove_constant' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `each' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ > webrick.rb:52 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:342:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `require' > from script/server:3 > > <--- > > > Someone? Anyone? Please help.... > > -- > *** E-Mail is NOT a SECURE channel *** > James B. Byrne mailto:ByrneJB@... > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > |
|
|
RE: Problems with setup Globalize and Postgresql databaseI don't think work has stalled, but there was a big chunk being brewed by
Saimon. I haven't heard from him in a while, so I'm not sure what is happening. Saimon? Chris Hapgood Phone: +1 434 989 8584 Skype: chris.hapgood Email: cch1@... -----Original Message----- From: Jurgen Fe?lmeier [mailto:jfesslmeier@...] Sent: Monday, July 09, 2007 17:30 To: users@... Subject: Re: Problems with setup Globalize and Postgresql database Hi James, I am also working with Globalize and have successfully integrated and deployed it on Linux / OS X and Solaris, however, on Windows I have had also problems, similar to those you have experienced. We are using MySQL, that could also be an issue. Neither this list nor the documentation did give me any clues as to which OSs are supported or how we could resolve OS specific problems. Has work entirely stalled on Globalize? Greetings, Juergen On 09.07.2007, at 17:15, James B. Byrne wrote: > > I seem to gotten past the setup problem by running "rake > globalize:create_tables" followed by "rake globalize:load_locale_data" > > However, now when I try to start my site (script/server) I get this > error: > > ---> > $ script/server > => Booting WEBrick... > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `remove_const': cannot remove Object::ViewTranslation (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `send' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:422:in > `remove_constant' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `each' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:368:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ > webrick.rb:52 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:342:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ > dependencies.rb:495:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in > `require' > from script/server:3 > > <--- > > > Someone? Anyone? Please help.... > > -- > *** E-Mail is NOT a SECURE channel *** > James B. Byrne mailto:ByrneJB@... > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > |
|
|
RE: Problems with setup Globalize and Postgresql databaseOn Mon, July 9, 2007 18:03, Chris Hapgood wrote: > I don't think work has stalled, but there was a big chunk being brewed by > Saimon. I haven't heard from him in a while, so I'm not sure what is > happening. > > Saimon? > I tried again with this product and I am not getting anywhere. I created a fresh rails project called tg and installed the globalize plugin for-1.2 therein. This time, instead of running rake globalize:setup I created a migration using script/generate globalize. Now when I run the migration (rake db:migrate) I get this: $ rake db:migrate --trace (in /home/byrnejb/software/tg) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == GlobalizeMigration: migrating ============================================== -- create_table(:globalize_countries, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_countries_id_seq" for serial column "globalize_countries.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_countries_pkey" for table "globalize_countries" -> 0.0280s -- add_index(:globalize_countries, :code) -> 0.0047s -- create_table(:globalize_translations, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_translations_id_seq" for serial column "globalize_translations.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_translations_pkey" for table "globalize_translations" -> 0.0206s -- add_index(:globalize_translations, [:tr_key, :language_id]) -> 0.0213s -- add_index(:globalize_translations, [:table_name, :item_id, :language_id], {:name=>"globalize_translations_table_name_and_item_and_language"}) -> 0.0049s -- create_table(:globalize_languages, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_languages_id_seq" for serial column "globalize_languages.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_languages_pkey" for table "globalize_languages" -> 0.0285s -- add_index(:globalize_languages, :iso_639_1) -> 0.0049s -- add_index(:globalize_languages, :iso_639_2) -> 0.0048s -- add_index(:globalize_languages, :iso_639_3) -> 0.0042s -- add_index(:globalize_languages, :rfc_3066) -> 0.0046s rake aborted! PGError: ERROR: currval of sequence "globalize_countries_id_seq" is not yet defined in this session : SELECT currval('globalize_countries_id_seq') /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in `execute' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:433:in `select' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:429:in `last_insert_id' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:138:in `insert' ./db/migrate//001_globalize_migration.rb:84:in `load_from_csv' /usr/lib/ruby/1.8/csv.rb:560:in `each' ./db/migrate//001_globalize_migration.rb:78:in `load_from_csv' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:867:in `silence' ./db/migrate//001_globalize_migration.rb:72:in `load_from_csv' ./db/migrate//001_globalize_migration.rb:57:in `real_up' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:212:in `send' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:212:in `migrate' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:212:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:335:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:330:in `each' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:330:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:297:in `up' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:288:in `migrate' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:4 /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 Is this product simply MySQL specific at the moment and just cannot be used with PostgreSQL? -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@... Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 |
|
|
Re: Problems with setup Globalize and Postgresql databaseOn Jul 11, 2007, at 5:20 PM, James B. Byrne wrote: > > Is this product simply MySQL specific at the moment and just cannot be > used with PostgreSQL? > AFAIK none of the active developers are using postgres. If you could look into a fix, that would be great! Joshua |
|
|
Re: Problems with setup Globalize and Postgresql databaseJust tried script/generate with psql, and it worked OK. This was on:
rails: 1.2.3 psql: 8.2.3 I think I remember problems with the migration on earlier psql versions... but it may have been something else :) Let me know if this doesn't fix the problem. Thanks ! == Dylan On Jul 12, 2007, at 3:57 AM, Joshua Sierles wrote: > > On Jul 11, 2007, at 5:20 PM, James B. Byrne wrote: >> >> Is this product simply MySQL specific at the moment and just >> cannot be >> used with PostgreSQL? >> > > AFAIK none of the active developers are using postgres. If you > could look into a fix, that would be great! > > Joshua |
|
|
Re: Problems with setup Globalize and Postgresql databaseI have been running globalize 1.1 with rails 1.1.6 on postgres without a
problem for a while now. I was just looking into upgrading to rails 1.2.3, and came across these posts. Installing globalize with postgres does work, at least for me. I tried to duplicate your issues, both with the 'rake globalize:setup' and with the migration. It worked for me both times. Those results are further below. There are some important problems with it, however. I see some attempts in the data.rake task to deal with postgres correctly, but it fails. I don't know MySql, but in Postgres sequences are separate things. The rake script inserts data into the tables *specifying* the id of the row, instead of allowing Postgres to generate it. Thus, after loading the data, the sequences are still at 1. You can see this by looking at them throught sql (do a \ds on psql prompt to see which ones they are). globalize_1_2_development=> select * from globalize_countries_id_seq; sequence_name | last_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called ----------------------------+------------+--------------+---------------------+-----------+-------------+---------+-----------+----------- globalize_countries_id_seq | 1 | 1 | 9223372036854775807 | 1 | 1 | 0 | f | t (1 row) This is a problem if you try to insert more data into any of these tables. The next insert would generate an ID of 1, which is already taken. In order to get those IDs right you can do two things: either do not insert the ID in the SQL, or update the sequences after the inserts are done. I tried the first, doing both columns.delete_at(0) row.delete_at(0) in the data.rake, load_from_csv (lines 19,27). Ok, about the install: This is with postgres 8.2.4, plus rails 1.2.3 on a mac. % rails globalize_1_2 -d postgresql % createdb -U postgres -O username something_development % cd globalize_1_2/ % emacs config/database.yml # make sure the right dbs are there. % ruby script/plugin install http://svn.globalize-rails.org/svn/globalize/branches/for-1.2 % rake globalize:setup NOTICE: CREATE TABLE will create implicit sequence "globalize_countries_id_seq" for serial column "globalize_countries.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_countries_pkey" for table "globalize_countries" NOTICE: CREATE TABLE will create implicit sequence "globalize_translations_id_seq" for serial column "globalize_translations.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_translations_pkey" for table "globalize_translations" NOTICE: CREATE TABLE will create implicit sequence "globalize_languages_id_seq" for serial column "globalize_languages.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_languages_pkey" for table "globalize_languages" Trying it the other way: % dropdb -U postgres globalize_1_2_development DROP DATABASE % createdb -U postgres -O bakongo globalize_1_2_development CREATE DATABASE % ./script/generate globalize create db/migrate exists db/migrate create db/migrate/001_globalize_migration.rb % rake --trace db:migrate (in /.../globalize_1_2) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == GlobalizeMigration: migrating ============================================== -- create_table(:globalize_countries, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_countries_id_seq" for serial column "globalize_countries.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_countries_pkey" for table "globalize_countries" -> 0.0097s -- add_index(:globalize_countries, :code) -> 0.0042s -- create_table(:globalize_translations, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_translations_id_seq" for serial column "globalize_translations.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_translations_pkey" for table "globalize_translations" -> 0.0119s -- add_index(:globalize_translations, [:tr_key, :language_id]) -> 0.0039s -- add_index(:globalize_translations, [:table_name, :item_id, :language_id], {:name=>"globalize_translations_table_name_and_item_and_language"}) -> 0.0067s -- create_table(:globalize_languages, {:force=>true}) NOTICE: CREATE TABLE will create implicit sequence "globalize_languages_id_seq" for serial column "globalize_languages.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "globalize_languages_pkey" for table "globalize_languages" -> 0.0110s -- add_index(:globalize_languages, :iso_639_1) -> 0.0036s -- add_index(:globalize_languages, :iso_639_2) -> 0.0033s -- add_index(:globalize_languages, :iso_639_3) -> 0.0030s -- add_index(:globalize_languages, :rfc_3066) -> 0.0032s == GlobalizeMigration: migrated (60.1271s) ==================================== ** Invoke db:schema:dump (first_time) ** Invoke environment ** Execute db:schema:dump Daniel Joshua Sierles wrote: > > On Jul 11, 2007, at 5:20 PM, James B. Byrne wrote: >> >> Is this product simply MySQL specific at the moment and just cannot be >> used with PostgreSQL? >> > > AFAIK none of the active developers are using postgres. If you could > look into a fix, that would be great! > > Joshua > |
|
|
Re: Problems with setup Globalize and Postgresql database(Yes, I know this is an old post - but it is still an open issue, this might be useful for somebody...)
There are two ways to fix this - One is to patch Rails. I just sent a bug report, and I'd expect it to be fixed as part of the next Rails release, as it is quite straightforward: http://dev.rubyonrails.org/ticket/11282 So, this would be the _proper_ way to fix it ;-) Now, you probably want a workaround. Very easy: After generating your 'globalize' migration, edit the generated file (say, db/migrate/009_globalize_migration.rb). Search for the following block: reader.each do |row| next if row.first.nil? # skip blank lines raise "No table name defined" if !table_name raise "No header defined" if !column_clause values_clause = row.map {|v| cnx.quote(v).gsub('\\n', "\n").gsub('\\r', "\r") }.join(', ') sql = "INSERT INTO #{table_name} (#{column_clause}) VALUES (#{values_clause})" cnx.insert(sql) end end Where it is? Depends on the type of migration you requested - for the 'tiny' migration, it's at line 78. Replace cnx.insert(sql) with cnx.execute(sql) - And that's it, the migration now works. |
|
|
Re: Problems with setup Globalize and Postgresql databaseOn 4 Mar 2008, at 22:25, Gunnar Wolf wrote:
Tim Peat Web Design and Development www.timpeat.co.uk tel +44 (0)133 531 00 00 mob +44 (0)771 533 94 88 |
|
|
German default translationsHi everyone,
I just spent a very bad moment trying to figure out what was going on in my application, I couldn't translate the dates in german... I didn't notice there was no entries in translation_data.csv for the german language (language_id = 1556) I find it really amazing that months or weekdays can be available in Yiddish or Chinese but not in German ..... well, hopefuly my german is a bit better than my chinese, so I prepared a custom translation_data.csv for my future projects, maybe I didn't search the list well enough and this will be useless or I missed something, but in case, here's what's must be added to the "translation_data.csv" to have german days & month. 7031,"ViewTranslation","Sunday [weekday]","",,"",1556,"Sonntag",1 7032,"ViewTranslation","Monday [weekday]","",,"",1556,"Montag",1 7033,"ViewTranslation","Tuesday [weekday]","",,"",1556,"Dienstag",1 7034,"ViewTranslation","Wednesday [weekday]","",,"",1556,"Mittwoch",1 7035,"ViewTranslation","Thursday [weekday]","",,"",1556,"Donnerstag",1 7036,"ViewTranslation","Friday [weekday]","",,"",1556,"Freitag",1 7037,"ViewTranslation","Saturday [weekday]","",,"",1556,"Samstag",1 7038,"ViewTranslation","Sun [abbreviated weekday]","",,"",1556,"Son",1 7039,"ViewTranslation","Mon [abbreviated weekday]","",,"",1556,"Mon",1 7040,"ViewTranslation","Tue [abbreviated weekday]","",,"",1556,"Die",1 7041,"ViewTranslation","Wed [abbreviated weekday]","",,"",1556,"Mit",1 7042,"ViewTranslation","Thu [abbreviated weekday]","",,"",1556,"Don",1 7043,"ViewTranslation","Fri [abbreviated weekday]","",,"",1556,"Fre",1 7044,"ViewTranslation","Sat [abbreviated weekday]","",,"",1556,"Sam",1 7045,"ViewTranslation","January [month]","",,"",1556,"Januar",1 7046,"ViewTranslation","February [month]","",,"",1556,"Februar",1 7047,"ViewTranslation","March [month]","",,"",1556,"März",1 7048,"ViewTranslation","April [month]","",,"",1556,"April",1 7049,"ViewTranslation","May [month]","",,"",1556,"Mai",1 7050,"ViewTranslation","June [month]","",,"",1556,"Juni",1 7051,"ViewTranslation","July [month]","",,"",1556,"Juli",1 7052,"ViewTranslation","August [month]","",,"",1556,"August",1 7053,"ViewTranslation","September [month]","",,"",1556,"September",1 7054,"ViewTranslation","October [month]","",,"",1556,"Oktober",1 7055,"ViewTranslation","November [month]","",,"",1556,"November",1 7056,"ViewTranslation","December [month]","",,"",1556,"Dezember",1 7057,"ViewTranslation","Jan [abbreviated month]","",,"",1556,"Jan",1 7058,"ViewTranslation","Feb [abbreviated month]","",,"",1556,"Feb",1 7059,"ViewTranslation","Mar [abbreviated month]","",,"",1556,"Mär",1 7060,"ViewTranslation","Apr [abbreviated month]","",,"",1556,"Apr",1 7061,"ViewTranslation","May [abbreviated month]","",,"",1556,"Mai",1 7062,"ViewTranslation","Jun [abbreviated month]","",,"",1556,"Jun",1 7063,"ViewTranslation","Jul [abbreviated month]","",,"",1556,"Jul",1 7064,"ViewTranslation","Aug [abbreviated month]","",,"",1556,"Aug",1 7065,"ViewTranslation","Sep [abbreviated month]","",,"",1556,"Sep",1 7066,"ViewTranslation","Oct [abbreviated month]","",,"",1556,"Okt",1 7067,"ViewTranslation","Nov [abbreviated month]","",,"",1556,"Nov",1 7068,"ViewTranslation","Dec [abbreviated month]","",,"",1556,"Dez",1 bye julien |
| Free embeddable forum powered by Nabble | Forum Help |