문제

이 스레드에 언급 된 Action_Mailer 패치를 적용하고 싶지만 이전에는 패치를 적용한 적이 없으며 어떻게 작동하는지 잘 모르겠습니다.https://rails.lighthouseapp.com/projects/8994/tickets/2263

My Action Mailer Gem은 여기에 있습니다 : /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2

나는 그 디렉토리로 가서 패치 명령을 실행해야한다고 생각합니다 ... 이런 것?

cd /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/
wget https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
patch < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch

내가 실제로 명확하지 않은 한 가지는 패치 파일이 "ActionMailer"디렉토리를 지칭하지만 광산은 "ActionMailer-2.3.2"라고합니다.

도움이 되었습니까?

해결책

당신은 일반적으로 보석 소스 자체를 패치하고 싶지 않습니다. 당신은 아마 보석을 얼리고 싶을 것입니다 ${RAILS_ROOT}/vendor/rails, 그런 다음 패치를 로컬로 바릅니다.

$ {rails_root} dir에서 모든 레일 보석을 공급 업체/레일에 버립니다.

rake rails:freeze:gems

패치를 적용하십시오

  cd vendor/rails/ 
  patch -p1 < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch

다른 팁

위의 Micholson의 답변은 작동합니다. 그러나 모든 Rails 앱에 대한 실제 보석을 패치하기 위해 (그의 답변에 대한 나의 의견 참조) 이것은 효과가있었습니다.

cd /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/actionmailer-2.3.2
wget sudo wget https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
sudo patch -p2 < 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch
sudo rm 0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch

나는 당신이 무언가 잘못되면 -r로 패치를 뒤집을 수 있다는 것을 알았습니다. 이 과정이 어딘가에 문서화되지 않았다는 것에 놀랐습니다. 바라건대 이것은 저처럼 패치하는 사람들을위한 Google 검색에서 나타날 것입니다.

다음은 보석을 패치하기위한 쉘 1 라이너입니다.

patch -d "$(gem env gemdir)"/gems/actionmailer-* -p1 < <(curl -s https://rails.lighthouseapp.com/attachments/108548/0001-Fix-implicit-multipart-mailer-views-when-RAILS_ROOT.patch)

사용하는 또 다른 예 gist 보석:

patch -d "$(gem env gemdir)"/gems/gist-* -p1 < <(curl -s https://github.com/defunkt/gist/commit/5843e9827f529cba020d08ac764d70c8db8fbd71.patch)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top