pluginのmigrate失敗について

538 views
Skip to first unread message

Tomohisa Kusukawa

unread,
Sep 24, 2012, 9:09:02 AM9/24/12
to redmine-users-ja
いつもお世話になっております。くすかわと申します。

WorkTimeというプラグインを公開しているのですが、
あるユーザの方からの問い合わせで、
Redmineのバージョンを2.1に上げた際に
pluginのmigrateで下記のエラーが出て
失敗するとの報告を頂いております。

↓↓↓↓↓↓↓↓
(in /home/redmine/redmine-2.1.0)
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can't convert Errno::EACCES into String
/home/redmine/redmine-2.1.0/lib/redmine/plugin.rb:360:in `+'
/home/redmine/redmine-2.1.0/lib/redmine/plugin.rb:360:in `rescue in
block in mirror_assets'
/home/redmine/redmine-2.1.0/lib/redmine/plugin.rb:354:in `block in
mirror_assets'

/usr/local/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/local/bin/rake:32:in `<main>'
Tasks: TOP => redmine:plugins:migrate => environment
↑↑↑↑↑↑↑↑

原因がわからず、問題の再現も出来ずに困っております。

上記の原因(の調べ方)をご存じの方、エラーを見た事がある方など、
もし、いらっしゃいましたら、何でも結構ですので、
お知恵をお借りできますと、非常に助かります。

環境は下記とのことです。

・前の環境
Redmine1.2
WorkTime0.1.2

・後の環境
Redmine2.1.0
ruby1.9.3p194
rake0.9.2.2
rails-3.2.8
WorkTime0.2.6

よろしくお願い致します。
--
t.kus...@gmail.com
http://about.me/kusu

nobu_toyofuku

unread,
Sep 25, 2012, 4:46:42 AM9/25/12
to redmine-...@googlegroups.com
豊福です。

2012年9月24日 22:09 Tomohisa Kusukawa <t.kus...@gmail.com>:
> can't convert Errno::EACCES into String
> /home/redmine/redmine-2.1.0/lib/redmine/plugin.rb:360:in `+'
> /home/redmine/redmine-2.1.0/lib/redmine/plugin.rb:360:in `rescue in
> block in mirror_assets'

該当の場所は def mirror_assets の中の
source_files.each do |file|
begin
target = File.join(destination, file.gsub(source, ''))
unless File.exist?(target) && FileUtils.identical?(file, target)
FileUtils.cp(file, target)
end
rescue Exception => e
raise "Could not copy #{file} to #{target}: \n" + e
end
end
の raise のところなので assets のファイルをコピーしようとして
permission denied でエラーになっているのではないかと思います。

まずは
ls -lR public/plugin_assets plugins/redmine_work_time
の結果を見せてもらって permission に問題ないかチェックしては
どうでしょう。

> can't convert Errno::EACCES into String

raise "Could not copy #{file} to #{target}: \n" + e
が間違っているのが原因で
raise "Could not copy #{file} to #{target}: \n" + e.to_s
になっているべきだと思います。
これの11行上の
raise "Could not create directory #{target_dir}: \n" + e
も同様。
---

Tomohisa Kusukawa

unread,
Sep 25, 2012, 7:11:21 PM9/25/12
to redmine-...@googlegroups.com

豊福さん
楠川です
情報、本当にありがとうございます。
パーミッションを確認して頂くように連絡しました。
結果がわかりましたら、
また報告させて頂きます。

2012/09/25 17:46 "nobu_toyofuku" <nobu.t...@gmail.com>:
--
このメールは Google グループのグループ「Redmine Users (japanese)」の登録者に送られています。
このグループに投稿するには、redmine-...@googlegroups.com にメールを送信してください。
このグループから退会するには、redmine-users-...@googlegroups.com にメールを送信してください。
詳細については、http://groups.google.com/group/redmine-users-ja?hl=ja からこのグループにアクセスしてください。

Tomohisa Kusukawa

unread,
Sep 26, 2012, 10:07:40 AM9/26/12
to redmine-...@googlegroups.com
楠川です。

パーミッションを確認するために、
外していたプラグインを再度入れたら、
問題無く動いたそうです。

お手数だけをおかけして大変申し訳無かったのですが
おかげさまで、何かしら次のアクションが取れたからこそ、
改めて動作確認できた訳ですし、本当にありがとうございました。

下記が頂いた連絡です。私、英語は全然ダメなので、勘違いしてたら言ってください。

> The plugin was not installed in the redmine/plugins dir, as it was breaking down redmine. So I reinstalled to provide you the ls -lR output. After I unzipped it and run `rake redmine:plugins:migrate RAILS_ENV=production` it has completed without any error. Checking the web interface, it works now!
>
> I believe that it was a permission issue which was resolved in the meanwhile after I stopped trying to migrate the work_time plugin. To conclude, I don't think that the error was in your plugin, it was just the point it surfaced. Anyway, thank you for your help!

--
t.kus...@gmail.com
http://about.me/kusu


2012年9月26日 8:11 Tomohisa Kusukawa <t.kus...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages