rakeではデバッグオプションがないため、オプション付きにしたものを$HOME/binに用意して実行した。
cd
mkdir bin
cd bin
cp /var/ruby/1.8/gem_home/bin/rake ./
vi ./rake
----------
#!/usr/ruby/1.8/bin/ruby -d <= 先頭にオプションを指定
----------
すると、以下のような感じになったがまだよくわからず。
Exception `Errno::EEXIST' at /usr/ruby/1.8/lib/ruby/1.8/fileutils.rb:243 - File exists - /export/home/webadm/redmine-0.8.5/public/plugin_assets/redmine_hudson/images
Exception `MissingSourceFile' at /usr/ruby/1.8/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- holidays
Exception `Errno::EEXIST' at /usr/ruby/1.8/lib/ruby/1.8/fileutils.rb:243 - File exists - /export/home/webadm/redmine-0.8.5/public/plugin_assets/redmine_schedules/javascripts
Exception `Errno::EEXIST' at /usr/ruby/1.8/lib/ruby/1.8/fileutils.rb:243 - File exists - /export/home/webadm/redmine-0.8.5/public/plugin_assets/redmine_schedules/stylesheets
Exception `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/plugins/gloc-1.1.0/lib/gloc.rb:191 - can't convert Hash into String
Exception `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/rails/activesupport/lib/active_support/dependencies.rb:506 - can't convert Hash into String
Exception `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/rails/activesupport/lib/active_support/dependencies.rb:513 - can't convert Hash into String
rake aborted!
can't convert Hash into String
しかたないので、gloc.rb を編集して情報出力するようにする。
cp -p redmine/vendor/plugins/gloc-1.1.0/lib/gloc.rb ~/ <= オリジナルの退避
vi redmine/vendor/plugins/gloc-1.1.0/lib/gloc.rb
----------
_verbose_msg {"Reading file #{filename} [charset: #{file_charset} --> #{dest_charset}]"} <= どうやったらこれが出力されるか??
print "Reading file #{filename} [charset: #{file_charset} --> #{dest_charset}]" <= これを追加
----------
実行してみると。以下の場所が分かった。
Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_hudson/lang/de.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_hudson/lang/ja.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/en.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/nl.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/es.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/pt-br.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadmException `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/plugins/gloc-1.1.0/lib/gloc.rb:191 - can't convert Hash into String
Exception `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/rails/activesupport/lib/active_support/dependencies.rb:506 - can't convert Hash into String
Exception `TypeError' at /export/home/webadm/redmine-0.8.5/vendor/rails/activesupport/lib/active_support/dependencies.rb:513 - can't convert Hash into String
rake aborted!
can't convert Hash into String
(See full trace by running task with --trace)
/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/it.yml [charset: utf-8 --> utf-8]Reading file /export/home/webadm/redmine-0.8.5/vendor/plugins/redmine_goyello_schedules/lang/pl.yml [charset: utf-8 --> utf-8]
この、最後の pl.yml が問題で、plがどこの国かここ調べたら、ポーランドで。pl.ymlはポーランド語用のLocaleファイルなのだが、形式が間違っていた。(config/locale/pl.yml の形式)
正しい形式:
head -2 redmine/vendor/plugins/redmine_goyello_schedules/lang/en.yml
----------
label_bulk_schedules_index: Bulk schedule
label_schedules_my_index: My schedule
----------
誤り形式:
head -2 redmine/vendor/plugins/redmine_goyello_schedules/lang/pl.yml
----------
pl:
label_schedules_my_index: Moj harmonogram
----------
これを修正して、migrateを実行すると、「"?dzony vs. harmo"...」
pl.yml がUTF-8でないのかな???? この lang/pl.yml と config/locale/pl.yml を比較してみる。
ls -l vendor/plugins/redmine_goyello_schedules/config/locales/pl.yml
-rw-r--r-- 1 webadm staff 3744 2009-10-21 13:39 vendor/plugins/redmine_goyello_schedules/config/locales/pl.yml
webadm@ext-zone:~/redmine$ ls -l vendor/plugins/redmine_goyello_schedules/lang/pl.yml
-rw-r--r-- 1 webadm staff 2420 2009-10-21 18:56 vendor/plugins/redmine_goyello_schedules/lang/pl.yml
どうやらファイルが不正らしいので、コピーして1行目だけを削除して作り直す。
しかしまたまたエラー
Migrating actionwebservice...
Migrating acts_as_activity_provider...
Migrating acts_as_attachable...
Migrating acts_as_customizable...
Migrating acts_as_event...
Migrating acts_as_list...
Migrating acts_as_searchable...
Migrating acts_as_tree...
Migrating acts_as_versioned...
Migrating acts_as_watchable...
Migrating classic_pagination...
Migrating coderay-0.7.6.227...
Migrating gloc-1.1.0...
Migrating gravatar...
Migrating redmine_estimations...
Migrating redmine_goyello_schedules...
== 1 CreateScheduleEntry: migrating ===========================================
-- create_table(:schedule_entries)
rake aborted!
SQLite3::SQLException: table "schedule_entries" already exists: CREATE TABLE "schedule_entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer DEFAULT 0 NOT NULL, "project_id" integer DEFAULT 0 NOT NULL, "date" date NOT NULL, "hours" float NOT NULL)
(See full trace by running task with --trace)
その3に続く。
0 件のコメント:
コメントを投稿