Ruby on Rails Thursday, January 30, 2014

Hello All,

I am trying to integrate god with nginx+passenger.
Rails 3.2.8, Ruby 1.9.3

I am not getting the exact process how to integrate it.
Should I create a .god file inside config in our project or outside project?
How can I link this to the servers?



Thanks,
Avi

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0f800d75-2d0a-447f-ad7b-3876c604086e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Its working fine now. We have changed from thin to nginx + passenger.

Thanks for helping.

On Wednesday, January 29, 2014 9:41:45 PM UTC+5:30, Hassan Schroeder wrote:
On Wed, Jan 29, 2014 at 6:55 AM, Avi <aavinas...@gmail.com> wrote:

> I am using "Thin server" in production.
> Ruby - 1.9.3
> Rails - 3.2.8

There's a known similar problem with Puma that I ran into -- see this
support entry: https://docs.newrelic.com/docs/ruby/puma#daemonizing

WAG: I don't use Thin but you might try setting ` --servers 1` and see
if that "fixes" it. Otherwise, open a ticket with newrelic. :-)

(Also, your Rails version has security issues; you should upgrade.)

HTH,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/725a7bfd-5c20-405a-92da-a14d790e6f04%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



The problem is solved. I forgot to add following in model:

has_attached_file :resume_attachment

In addition, I looked at this reference and saved the file in paperclip through File class

     my_model_instance = MyModel.new
     file = File.open(file_path)
     my_model_instance.attachment = file
     file.close
     my_model_instance.save!

Thanks. 

--
Regards,
Ankur 

On 31 January 2014 01:35, Ankur Kumar <specialankur@gmail.com> wrote:

I am trying to save a pdf file (generated using Rails PDFKit gem) to a paperclip attachment. The MySQL table entry shows following for the paperclip attachment after saving the generated PDF file:

MySQL table record:

*************

id | resume_type | resume_attachment_file_name | resume_attachment_content_type | resume_attachment_file_size | resume_attachment_updated_at

1   | pdf   |   !ruby/object:File {}   |   NULL   |   NULL |   NULL |

**************

as against expected value to be something like in this format:

resume.pdf | application/pdf | 38375 | 2014-01-30 18:24:34

**************

Can someone please tell me what's going wrong here?

Controller:

    html = render_to_string('resume.html.erb',layout: false)  kit = PDFKit.new(html, :page_size => 'Letter')    file_name = "resume"    path = "#{Rails.root}/app/assets/PDF/" + file_name.to_s + ".pdf"  **file** = kit.to_file(path)    document = Document.new(:resume_type=>"pdf")  document.resume_attachment_file_name = **file**  document.save! 

schema.rb

    create_table "documents", :force => true do |t|  t.string   "resume_type"  t.string   "resume_attachment_file_name"  t.string   "resume_attachment_content_type"  t.integer  "resume_attachment_file_size"  t.datetime "resume_attachment_updated_at"

Thanks.

Regards,

Ankur


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALSL1eOM69QXNqzZWX2mh3U9in_JSpTB%3DkKjAUZHa9JaAzBpCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.