erubi
๋ํ ์ข
์์ฑ์ด ์๋ better_errors
2.3.0์ผ๋ก Rails ์ ํ๋ฆฌ์ผ์ด์
์ ์คํํ๋ ค๊ณ ํ๋ฉด(2.2.0์์์ ๊ฐ์ด erubis ๋์ ) ๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
.bundle/ruby/2.4.0/gems/haml-5.0.2/lib/haml/helpers/safe_erubi_template.rb:5: warning: toplevel constant Erubi referenced by ActionView::Template::Handlers::ERB::Erubi
rails aborted!
TypeError: superclass must be a Class (Module given)
.bundle/ruby/2.4.0/gems/haml-5.0.2/lib/haml/helpers/safe_erubi_template.rb:5:in `<module:Haml>'
.bundle/ruby/2.4.0/gems/haml-5.0.2/lib/haml/helpers/safe_erubi_template.rb:4:in `<top (required)>'
.bundle/ruby/2.4.0/gems/activesupport-5.0.5/lib/active_support/dependencies.rb:293:in `require'
.bundle/ruby/2.4.0/gems/activesupport-5.0.5/lib/active_support/dependencies.rb:293:in `block in require'
Rails 4์์๋ ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
better_errors๋ฅผ ์ ๊ฑฐํ๋ฉด ๋ฌธ์ ๋ฅผ ํผํ ์ ์์ต๋๋ค.
better_errors 2.3.0์ erubi
์ ๋ํ ์ข
์์ฑ์ ์ถ๊ฐํฉ๋๋ค. ์ด๋ better_errors๊ฐ Gemfile์ ์๋์ง ์ฌ๋ถ์ ๊ด๊ณ์์ด Gemfile์ erubi
๋ฅผ ์ถ๊ฐํ์ฌ ์ฌํํ ์ ์์ต๋๋ค.
Erubis๊ฐ ๋ฒ๋ค์ ์ถ๊ฐ๋๋ฉด haml์ Erubi๋ฅผ ์ ํํฉ๋๋ค. Rails 5.0.5์์๋ lib/haml/helpers/safe_erubi_template.rb
์ class
์ ์ธ ๋ผ์ธ์์ ์์ธ๊ฐ ๋ฐ์ํฉ๋๋ค.
module Haml
class ErubiTemplateHandler < ActionView::Template::Handlers::ERB::Erubi
ActionView::Template::Handlers::ERB::Erubi
๋ ๋งค์ฐ ์ ๋นํ ๊ฐ์ฒด์ด์ง๋ง Erubi
๋ชจ๋์ ๋ํ ์์ํ ์ฐธ์กฐ์ธ ๊ฒ์ผ๋ก ๋ณด์ด๋ฉฐ ๊ฒฝ๊ณ ๋ ์ค๋ช
ํฉ๋๋ค.
> Where.is(ActionView::Template::Handlers::ERB::Erubi)
(pry):1: warning: toplevel constant Erubi referenced by ActionView::Template::Handlers::ERB::Erubi
=> ["/usr/local/var/rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/erubi-1.6.1/lib/erubi.rb", 24]
actionview, erubi, haml ๋๋ haml-rails์์ ActionView::Template::Handlers::ERB::Erubi
์ ์ง์ ์ ์ธ ์ ์ธ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ ๋ฐ๋ฅด๋ฉด Erubi
์ ๋ณต์ฌ๋ณธ์ด๋ฉฐ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.
๋๋ ๊ทธ๊ฒ์ ์กฐ๊ธ ์ขํ๋ค: ActionView::Template
์ ๋ค์์คํ์ด์ค ์๋์์ ์ฐธ์กฐ๋๋ ๋ชจ๋ ์์๋ ๋ฃจํธ ๋ค์์คํ์ด์ค์ ์๋ ๊ทธ ์์์ ๋ํ ์ฐธ์กฐ๋ฅผ ์ผ๊ธฐํ๋ค:
> ActionView::Template::Erubi
(eval):1: warning: toplevel constant Erubi referenced by ActionView::Template::Erubi
> ActionView::Template::ActionView
(eval):1: warning: toplevel constant ActionView referenced by ActionView::Template::ActionView
> defined? ActionView::Template::Handlers::ERB::Erubi
=> "expression"
> defined? ActionView::Template::Handlers::ERB::sdfsdf
=> nil
> defined? ActionView::Template::Handlers::ERB::ActionView
=> "constant"
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด #948์ ์ด์์ต๋๋ค.
์ถ์ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ฆ๊ฑฐ์ด ์๊ฐ์ ๋ณด๋ด์ ๊ฒ ๊ฐ์ต๋๋ค.
2017๋
8์ 8์ผ ํ์์ผ ์คํ 2:53 Robin Daugherty [email protected]
์ผ๋ค:
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด #948 https://github.com/haml/haml/pull/948 ์ ์ด์์ต๋๋ค.
โ
์ค๋ ๋๋ฅผ ์์ฑํ๊ธฐ ๋๋ฌธ์ ์ด ๋ฉ์์ง๋ฅผ ๋ฐ๋ ๊ฒ์ ๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธ
https://github.com/haml/haml/issues/946#issuecomment-321048633 ๋๋ ์์๊ฑฐ
์ค๋ ๋
https://github.com/notifications/unsubscribe-auth/AAAH_kM6UUUnGmpu4Q8DljFSkdD6U6PXks5sWK6ugaJpZM4OuAVp
.
์ด ๋ฌธ์ ๋ ์์๊ณ gem Better Errors๋ฅผ 2.2.0์ผ๋ก ์์ ํ์ต๋๋ค.
๊ทธ๋ฌ๋ ์ค๋ ๋ด ์ฑ์ด ๋์ผํ ์ค๋ฅ๋ก ๋ค์ ์ค๋จ๋์์ต๋๋ค.
์ด๋ฒ์๋ i18n-tasks 0.9.17์ด ์์ธ์
๋๋ค! ์ด ๋ฌธ์ ๋ฅผ 0.9.16์ผ๋ก ์์ ํ๋ ๊ฒ์ด ํด๊ฒฐ ๋ฐฉ๋ฒ์
๋๋ค.
์ด๊ฒ์ด ๋๊ตฐ๊ฐ๋ฅผ ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
Better Errors 2.2.0์์ ์ ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๊ฐ์ฌ ํด์!
์ด ๋ฌธ์ ์ ์ฌ๋๋ค์ด https://github.com/haml/haml/pull/948์ ํฌํจํ์ฌ Haml์ ์ต์ ๋ง์คํฐ ๋ธ๋์น๋ฅผ ํ ์คํธํ๊ธฐ๋ฅผ
์ผ์ฐ ๋ณํฉํด์ ์ฃ์กํฉ๋๋ค. https://github.com/haml/haml/pull/952๋ฅผ ํฌํจํ์ฌ ๋ง์คํฐ๋ฅผ ์๋ํด ์ฃผ
๋๋ฅผ ์ํด ์๋ํฉ๋๋ค! ๊ฐ์ฌํฉ๋๋ค.
2017๋
8์ 18์ผ(๊ธ) ์ค์ 12:21 Takashi Kokubun [email protected]
์ผ๋ค:
์ผ์ฐ ๋ณํฉํด์ ์ฃ์กํ์ง๋ง #952๋ฅผ ํฌํจํ์ฌ ๋ง์คํฐ๋ฅผ ์ฌ์ฉํด ์ฃผ์๊ฒ ์ต๋๊น?
https://github.com/haml/haml/pull/952 ?โ
์ค๋ ๋๋ฅผ ์์ฑํ๊ธฐ ๋๋ฌธ์ ์ด ๋ฉ์์ง๋ฅผ ๋ฐ๋ ๊ฒ์ ๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธ
https://github.com/haml/haml/issues/946#issuecomment-323255535 ๋๋ ์์๊ฑฐ
์ค๋ ๋
https://github.com/notifications/unsubscribe-auth/AAAH_hNER0VSgtIDqnwURHQNAMF6LfFyks5sZRFRgaJpZM4OuAVp
.
๋ด ํ๋ก์ ํธ์์๋ ์ ์๋ํฉ๋๋ค. ๊ฐ์ฌ ํด์!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด ๋ฌธ์ ๋ ์์๊ณ gem Better Errors๋ฅผ 2.2.0์ผ๋ก ์์ ํ์ต๋๋ค.
๊ทธ๋ฌ๋ ์ค๋ ๋ด ์ฑ์ด ๋์ผํ ์ค๋ฅ๋ก ๋ค์ ์ค๋จ๋์์ต๋๋ค.
์ด๋ฒ์๋ i18n-tasks 0.9.17์ด ์์ธ์ ๋๋ค! ์ด ๋ฌธ์ ๋ฅผ 0.9.16์ผ๋ก ์์ ํ๋ ๊ฒ์ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋๋ค.
์ด๊ฒ์ด ๋๊ตฐ๊ฐ๋ฅผ ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.