https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-10-14T18:07:57ZRuby Issue Tracking SystemRuby master - Bug #5447: Rails can't create a new app when a folder with accented letter is in the pathhttps://redmine.ruby-lang.org/issues/5447?journal_id=213272011-10-14T18:07:57Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li></ul><p>It's thor's bug.</p> Ruby master - Bug #5447: Rails can't create a new app when a folder with accented letter is in the pathhttps://redmine.ruby-lang.org/issues/5447?journal_id=222552011-11-17T21:07:14Zgnal-ybur (Joël Brogniart)trash@ouvaton.org
<ul></ul><p>It's not a thor's bug. It's perhaps an issue related to the way ruby 1.9.3 is configured on Mac OS X. The issue is still there with ruby 1.9.3-p0.</p>
<p>Here is a sample test to see the problem (without using Thor).<br>
In OS X' Finder create a folder with accented letter in name (i.e. Émilie), create a sub folder in this folder (i.e. toto).<br>
in terminal, cd to the "toto" folder and then irb.</p>
<p>With ruby 1.9.2p290</p>
<blockquote>
<blockquote>
<p>d1 = Dir.getwd<br>
=> "/Users/billgates/Documents/tests/E\314\201milie/toto"<br>
d2 = File.expand_path(File.dirname(d1))<br>
=> "/Users/billgates/Documents/tests/E\314\201milie"<br>
d1.gsub(d2, '.')<br>
=> "./toto"</p>
</blockquote>
</blockquote>
<p>With ruby 1.9.3-p0<br>
ruby-1.9.3-p0 :001 > d1 = Dir.getwd<br>
=> "/Users/billgates/Documents/tests/Émilie/toto"<br>
ruby-1.9.3-p0 :002 > d2 = File.expand_path(File.dirname(d1))<br>
=> "/Users/billgates/Documents/tests/Émilie"<br>
ruby-1.9.3-p0 :003 > d1.gsub(d2, '.')<br>
RegexpError: invalid multibyte character: //Users/billgates/Documents/tests/E\xCC\x81milie/<br>
from (irb):3:in <code>gsub' from (irb):3 from /Users/billgates/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in </code>'</p>
<p>Yours</p> Ruby master - Bug #5447: Rails can't create a new app when a folder with accented letter is in the pathhttps://redmine.ruby-lang.org/issues/5447?journal_id=222562011-11-17T21:17:46Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Third Party's Issue</i> to <i>Closed</i></li></ul><p>Your research show the problem is derived an issue fixed by r33603,<br>
and the change will be backported by <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Pathname's raising "invalid sequence" (Closed)" href="https://redmine.ruby-lang.org/issues/5533">#5533</a>.<br>
So it will be fixed on next patch release of 1.9.3.</p>
<p>Thanks,</p> Ruby master - Bug #5447: Rails can't create a new app when a folder with accented letter is in the pathhttps://redmine.ruby-lang.org/issues/5447?journal_id=222572011-11-17T21:23:17Zgnal-ybur (Joël Brogniart)trash@ouvaton.org
<ul></ul><p>The problem seem to be related to File.expand_path.</p>
<p>With ruby 1.9.3-p0:</p>
<p>ruby-1.9.3-p0 :001 > d1 = Dir.getwd<br>
=> "/Users/brogniar/Documents/tests/Émilie/toto"<br>
ruby-1.9.3-p0 :002 > d2 = File.dirname(d1)<br>
=> "/Users/brogniar/Documents/tests/Émilie"<br>
ruby-1.9.3-p0 :003 > d3 = File.expand_path(d2)<br>
=> "/Users/brogniar/Documents/tests/Émilie"<br>
ruby-1.9.3-p0 :004 > d4 = d1.gsub(d2, '.')<br>
=> "./toto"<br>
ruby-1.9.3-p0 :005 > d4 = d1.gsub(d3, '.')<br>
RegexpError: invalid multibyte character: //Users/brogniar/Documents/tests/E\xCC\x81milie/<br>
from (irb):5:in <code>gsub' from (irb):5 from /Users/brogniar/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in </code>'</p>
<p>Yours</p> Ruby master - Bug #5447: Rails can't create a new app when a folder with accented letter is in the pathhttps://redmine.ruby-lang.org/issues/5447?journal_id=222582011-11-17T21:25:45Zgnal-ybur (Joël Brogniart)trash@ouvaton.org
<ul></ul><p>Oops, we where writing at the same time. Thanks for your response.</p>