By edawebdesign
I am using the Ruby on Rails on Ubuntu (nginx and unicorn) application image for my server. I configured unicorn and nginx to load my app and everything seemed to be working. Then I tried to use the contact form on my site and it appeared to work but nothing went through (it also completed too fast).
My first question is where can I find webrick like logs for my unicorn server? I looked at /home/unicorn/log/unicorn.log but that doesn’t have the information I need.
On reboot this is what the unicorn process looks like:
rails@edawebdesign:~$ ps -e f | grep unicorn 1179 pts/1 S+ 0:00 _ grep unicorn 779 ? Sl 0:00 unicorn master -D -c /home/unicorn/unicorn.conf -E production 782 ? Sl 0:02 _ unicorn worker[0] -D -c /home/unicorn/unicorn.conf -E production 784 ? Sl 0:02 _ unicorn worker[1] -D -c /home/unicorn/unicorn.conf -E production
This is the only way I can get my contact form to work:
Then I get a slightly different looking unicorn process list:
rails@edawebdesign:~/apps/edawebdesign/current$ ps -e f | grep unicorn 1243 pts/1 Sl 0:00 _ unicorn_rails master -l0.0.0.0:8080 1245 pts/1 Sl 0:01 | _ unicorn_rails worker[0] -l0.0.0.0:8080 1266 pts/1 S+ 0:00 _ grep unicorn
This results in my app working as expected. Anyone have an idea of what is going on here?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Does <code>/home/unicorn/unicorn.conf</code> state where the log files are stored? What mail server is your app configured to use?
This is my unicorn.conf:
<br>
<br>isten "127.0.0.1:8080" <br>worker_processes 2 <br>user "rails" <br>working_directory "/home/rails/apps/edawebdesign/current" <br>pid "/home/unicorn/pids/unicorn.pid" <br>stderr_path "/home/unicorn/log/unicorn.log" <br>stdout_path "/home/unicorn/log/unicorn.log"
<br>
<br>and this is the end of my /config/environments/production.rb:
<br>
<br>isten "127.0.0.1:8080" <br>worker_processes 2 <br>user "rails" <br>working_directory "/home/rails/apps/edawebdesign/current" <br>pid "/home/unicorn/pids/unicorn.pid" <br>stderr_path "/home/unicorn/log/unicorn.log" <br>stdout_path "/home/unicorn/log/unicorn.log"
edit: this is the end of my production.rb: <br> <br> config.log_formatter = ::Logger::Formatter.new <br> <br> config.assets.debug = true <br> config.action_mailer.smtp_settings = { <br> address: “smtp.gmail.com”, <br> port: 587, <br> domain: ENV[“DOMAIN_NAME”], <br> authentication: “plain”, <br> enable_starttls_auto: true, <br> user_name: ENV[“GMAIL_USERNAME”], <br> password: ENV[“GMAIL_PASSWORD”] <br> } <br> # ActionMailer Config <br> config.action_mailer.default_url_options = { :host => ENV[“DOMAIN_NAME”] } <br> config.action_mailer.delivery_method = :smtp <br> config.action_mailer.raise_delivery_errors = false <br> config.action_mailer.perform_deliveries = true
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.