Closed jeangali closed 10 years ago
What OS are you running under? What happens if you change "a" to "rb+"? On 10 Jun 2013 00:01, "jeangali" notifications@github.com wrote:
I get this error in input.log :
can't change access mode from "rb+" to "a": /home/tim/.rvm/gems/ruby-1.9.2-p320/gems/rails-latex-1.0.11/lib/rails-latex/latex_to_pdf.rb:25:in `reopen'
I fixed it by commenting lines 25 and 26 in latex_to_pdf.rb :
#STDOUT.reopen("input.log","a") #STDERR.reopen(STDOUT)
Any idea where this comes from ? All I can see is that tmp/rails-latex/input.log is missing, only tmp/rails-latex/[pid]-[hash]/input.log is generated.
Thanks for your help,
Jean
— Reply to this email directly or view it on GitHubhttps://github.com/jacott/rails-latex/issues/28 .
I confirm this exactly:
On 11 Jun 2013 03:44, "Andrey Korobkov" notifications@github.com wrote:
I confirm this exactly:
can't change access mode from "rb+" to "a"
Does it work if you change the "a" to "ab" ?
Hi, nice plugin! However, I miss the opportunity to inspect the generated latex-code directly.
I suggest the following addition to latex_to_pdf.rb:
class LatexToPdf
2 def self.config
3 @config||={:command => 'pdflatex', :arguments => ['-halt-on-error'], :parse_twice => false, :save_latex => nil }
4 end
and further
20 FileUtils.mkdir_p(dir)
21 File.open(input,'wb') {|io| io.write(code) }
22 unless config[:save_latex].nil?
23
24 File.open(save_latex,'wb') {|io| io.write(code) }
25
26 end
27
In the controller I specify: LatexToPdf.config.merge! :save_latex => "/dokumente/railsoutput/main.tex"
This simply writes the latex-source to the specified file and overwrites(updates it every time. In case of errors,I find it more easy, to correct them in the source and not in the erb-file and call pdflatex manually.
greetings from Stuttgart Hartmut
If you send me a PR with tests I'll (probably) merge it.
On 12 June 2013 21:38, topofocus notifications@github.com wrote:
Hi, nice plugin! However, I miss the opportunity to inspect the generated latex-code directly.
I suggest the following addition to latex_to_pdf.rb:
class LatexToPdf 2 def self.config 3 @config https://github.com/config||={:command => 'pdflatex', :arguments => ['-halt-on-error'], :parse_twice => false, :save_latex => nil } 4 end and further 20 FileUtils.mkdir_p(dir) 21 File.open(input,'wb') {|io| io.write(code) } 22 unless config[:save_latex].nil? 23 24 File.open(save_latex,'wb') {|io| io.write(code) } 25
26 end 27
In the controller I specify: LatexToPdf.config.merge! :save_latex => "/dokumente/railsoutput/main.tex"
This simply writes the latex-source to the specified file and overwrites(updates it every time. In case of errors,I find it more easy, to correct them in the source and not in the erb-file and call pdflatex manually.
greetings from Stuttgart Hartmut
— Reply to this email directly or view it on GitHubhttps://github.com/jacott/rails-latex/issues/28#issuecomment-19315410 .
With "ab" it's the same:
<STDOUT> can't change access mode from "rb+" to "ab"
What else could I try to fix it?
On 18 Jun 2013 03:14, "Andrey Korobkov" notifications@github.com wrote:
With "ab" it's the same:
can't change access mode from "rb+" to "ab" What else could I try to fix it?
Try "rb+". You may be able to leave the argument out altogether too.
This error occured after I upgraded to Passenger 4. Downgrading to 3 fixes it!
I found on the net that Passenger 4 uses STDOUT for internal purposes and doesn't like if you touch it. It even does some forcibly redirect of stdout to stderr, so probabnly that is the reason why it breaks here...
Jakub
Just for the record, I'm seeing the same thing. Changing the argument to "rb+" or leaving it out is not helping.
This appears to be a problem with Passenger 4+
I am not actively maintaining this gem any more but if someone sends me a PR fix I will publish it.
Otherwise please raise the issue with the passenger team.
+1
passenger has a related issue - see https://code.google.com/p/phusion-passenger/issues/detail?id=912
but there is no visible activity over there ;(
I get this error in input.log :