Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm a rails developer (with about a year of experience) and I am getting pretty comfortable with it, but I find that I lack even a cursory understanding of how deploys or servers work. I am familiar with terms like Unicorn or Apache, but I don't know much beyond the notion that they manage rails instances (?).
I have heard of chef, and I know it is used for deploys, but I don't know where I'd begin.
Is there a book or a screencast series that would be useful in learning this sort of thing?
(Side note: I have a project I want to make that will run sort of like a template builder and a web host, so understanding how to add domains/subdomains/manage that sort of thing is one of the primary drives for learning, other than the natural want to learn).
When dealing with remote (or even local) deploys, I find that the best solution is using capistrano. You can find all the information you need at their website.
You can start reading the long README from Github and then switch to more detailed information starting from here.
When deploying a Rails application, usually servers like Apache or nginx acts as a router to your application's local server. Eg. you start a thin server for your deployed app that answers on the 1234 port and configure Apache to redirect all the calls to you remote address to the local server at localhost:1234.
Capistrano will start/restart/stop the local Rails server through the configuration you'll put in the config files, so you'll have complete control over it.
Hopes this helps. You can find lots of information online about capistrano and the integration with various http servers and rails servers.
Eg. a good starting point can be this screencast made by Ryan Bates, but beware! This is for the older 2.x version of capistrano.
Don't go anywhere but straight to latest awesome chef fundamental series, check opsode user on youtube (http://www.youtube.com/user/Opscode).
First episode:
http://www.youtube.com/watch?v=yh9osPQA_-k
after it you can go to irc, docs, watch other advanced things (including berkshelf). But first things first.
I have lots of things to tell regarding this. I'm on chef for around a month, and I've spent tons of hours understanding how it works. And I'd say the official docs are just a disaster. They give everything in one place, although you don't need to know it in the begging. I can only offer you some resources like: http://learnchef.getharvest.com/ which is best ever introduction I've found around. All those official learnchef links didn't work out for me.
I'd really recommend to stay away from Vagrant for a while, just buy a 5$ vps on DigitalOcean cloud and try this manual: http://adamcod.es/2013/06/04/deploy-a-basic-lamp-stack-digital-ocean-chef-solo.html
Start with a chef-solo instead of chef-server, and try knife-solo. Use berkshelf although it's rarely mentioned in official docs, because chef can't handle cookbook dependencies although it can download cookbooks. then slowly start looking how I've automatized a chef-server installation: http://github.com/holms/chef-starter This will give you an idea, which steps to take for chef-server setup, and how to deploy stuff with knife.
After all that, try vagrant, as it offers to run everything from your desktop machine. I've started from vagrant and I've wasted too much time. When you put chef-server and vagrant together, you get tons of information which you just unable to handle. Lots of cave heats appears, lots of things to write.. you ending up wasting your 40 hours non-stop learning, without achieving your desired results.
You can contact me on freenode irc if you need any help. I'd never wish this chef experience even to my enemy.
Update:
This is quite old comment :) So just ignore it. Ended up using vagrant+chef, then vagrant+ansible, now using docker. To be exact docker+traefik
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm confused by Rails Deployment.
I followed this guide(https://github.com/rocodev/guides/wiki/setup-production-development) to setup environment on my server.
I have done all the installation proccess, but it doesn't work!!
When I run 'cap deploy:setup', it asked me to type password, and I typed, but it said permission denied.
I couldn't find out what the problem is, and I can't clearly know some parts of this guide.
Are there any resources(maybe a book) can give me a robust understanding about Rails Deployment?
Thank you.
There are a couple of books on Rails deployment practices:
Deploying Rails: Automate, Deploy, Scale, Maintain, and Sleep at Night published by the PragProgs. Written in 2012, and focusing on Rails 3.x, but should still be mostly up to date (really nothing much has changed in the space in the last 2 years). (Or, the old versions of the tools aren't super broken and still widely used).
Reliably Deploying Rails Applications, published via LeanPub. 80% done as of this writing, and does incorporate the bleeding edge tools.
I haven't read the latter book, but I have read the former book and liked it reasonably well.
I don't think you need to read a book on rails deployment for fixing production issues. Once you complete a book, It's not mean you able to deploy your app seamless manner. Still issue will occur and you will run to Google. We always leant form our mistakes and by fixing them.
I would suggest have a look to small blogs and tutorial.
Deploying to a VPS
HOW TO DEPLOY RAILS APPLICATION TO VPS
Setup A Ubuntu VPS For Hosting Ruby On Rails Applications
Deploying Rails to Dreamhost VPS
Capistrano Tasks
Capistrano Tasks (revised)
If you really want a deep understanding of rails development. Go ahead with below book.
Deploying Rails: Automate, Deploy, Scale, Maintain, and Sleep at Night
I started with these two RailsCasts:
Manual setup of a rails environment on a VPS: http://railscasts.com/episodes/335-deploying-to-a-vps
Automating the above with capistrano: http://railscasts.com/episodes/337-capistrano-recipes
There's a lot of other tools / options, but this is a pretty common (simple) way of managing and deploying servers. I use this basic setup for managing 2 different clustered environments, with 3 servers each (one of them is not rails) + an NFS between them - works well.
BUT, if you can, I'd really look at PaaS (like Heroku) options. I also run a more vanilla rails web app on this platform and it saves me a lot of time in server maintenance, management, and scripting.
I am attempting to determine what can possibly be the causative factor for 20+ second response times from a Rails 3 application located in EC2 using Elasticache. I have reason to believe the problem is in fact cache related, but I have no numbers to prove it. I'd like to get those numbers. For the sake of completeness, we're running the applications atop Ubuntu 12.04 .
Searching Google, I found nothing directly relevant to my situation, and no StackOverflow topics I could find were even remotely relevant to my situation. If anyone can point me to some documentation on the matter, I'd be quite appreciative. Thank you!
I've found the best tool for this to be New Relic.
http://newrelic.com/
I don't work for them and get no benefit from you trying them.
They have a free level that you can start with. If you go up to the non-free version you can literally trace all your requests through different models and into the database telling you how long the app spent in each section. It's a great tool for profiling.
Do you, by any chance have access to standard web logs including URLs and response times?
I faced a similar situation, searched the web, found nothing relevant, and eventually decided to roll my own, which I shared in this SO post:
Profiling a multi-tiered, distributed, web application (server side)
While it is far from perfect and may be too high level for some use-cases, it gave me a pretty quick and broad insight into where the application I was trying to profile is spending most of its time in, and what the slowest parts are. HTH.
The best parts of it are that:
It is 100% platform and programming language independent.
It is a 100% free software solution
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Looking for some suggestions from the community for development stacks for collaborative environments. Could you share what you have and what has worked for you or your team?
The following is probably too verbose for some and an expression of just some rambling thoughts I've had about my particular scenario as I'm working with a hatchling dev group. SO, if you read it 1UP for you, otherwise, please just feel free to just share your thoughts re: the first question and what's worked for your team.
I have a situation where myself and a couple other developers are working together and I'd like to set up the "best" dev environment possible for Ruby on Rails development. At the moment I use git and some of the usually accepted best practices for development, however the other guys are new and not terribly familiar with the shell, git, etc. They're more from a php and monolithic environment.
I do have a central linux server that has been used hitherto for LAMP based dev for them. I can retool it to anything I'd like it to be as I'm quite adept and experienced at Unix system and network admin.
Could someone please suggest what may work well in this scenario? Again, ultimately we need to do collaborative development that has the lowest learning curve. I'll be the only one deploying to Heroku until I feel comfortable with their experience.
I would like to put something together that can get us all up to speed quickly in a matter of a day vs a longer learning curve and then allow them to grow into the shell and so forth over the next couple weeks.
What I was thinking was more of a shared SMB (mixed Windows and Mac workstations) and SFTP unified projects folder that has either apache virtual hosts for each project or thin rack. I'd continue to use my methods, but this could provide the flexibility for them to grow into this and be able to restart httpd or thin as per need.
Am I on the proverbial right track or has someone seen a better alternative? A lot of things have crossed my mind such as Gitorious (since we'll have a lot of small projects needing to be tracked and an enormous GitHub account is not feasible), Heroku, OpenShift and a lot of other things, but I have enough uncertainty that I'd like to get some input from the community as to the right mix for great collaborative agile development.
I have an answer but I think you have conflicting requirements: i.e. lowest learning curve vs low/free cost.
You say that GitHub is not feasible but it does offer unparalleled features for novice users. They can see commits on a website instead of on the commandline, can even edit files right in the browser (since yesterday, uses Ace) and gain insight into the branching/merging process.
Another paid option is http://cloud9ide.com/ which is also web-based.
I use my own development server as well but only use it for experienced people who need no hand-holding. If I were to let everyone on there the amount of support would consume my entire day.
It is my opinion that doing Rails development people should adopt the best practices in the field. See it like this: at least you won't burden them with learning Subversion or --eek-- CVS. Just seeing the commits on GitHub and having a discussion right after puzzling pieces of code is worth the money.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Sorry for the broad question, but I'd really like to know the combination of services people are using to get great monitoring for their apps. Right now, I'm thinking of going with Pingdom + Hoptoad (+ PagerDuty), but I want to know what others are using as pretty much everything I'm deciding between has several competitors.
I want to know when my app is unreachable, unstable, or down
I want to do basic sanity check that my app is good (renders something), but doesn't have to be deep (no need to simulate a log in for a 'ping')
I want to be able to cheaply and easily add new things to monitor
I want to be able to generate my own notifications (Seems pretty standard now, but worth calling out)
I want to know when I get a lot of exceptions (the odd one here and there I'm willing to check in the morning, but 1 every few min is worth getting up for)
I want reporting
It needs to scale with multiple apps, apps running across multiple nodes, and with multiple users on the same projects.
I've seen the Hoptoad vs. Exceptional discussion. I'm more interested in what people have put together to form their entire monitoring suite. What are you using? What do you like about it? What do you not like about it?
Would really love to get suggestions!
These are the tools we use for monitoring:
Monit: http://mmonit.com/monit/
For both internal & external monitoring: apache, nginx, mongrel, mysql, sphinx, delayed_job, postfix, CPU, etc
Whenever a process goes down, its will try to bring it up. If it is not able to start a process it will notify us.
Cloudkick: https://www.cloudkick.com/
For both internal & external. We are in the process of evaluating this tool. It supports rackspace, ec2, slicehost, etc. If you use more than one cloud services, this tool might help you.
Alert Grid: http://alert-grid.com/
For monitoring our cron tasks.
Exception Notification:
Error App: http://errorapp.com/ - Its free
Airbrake(hoptoad) http://airbrakeapp.com/pages/home
Logwatch:
http://linuxcommand.org/man_pages/logwatch8.html - Sends daily report about whats happening in a server. Like new packages installed, list of cron tasks running, authentication failures, etc.
Intrusion Detection:
http://www.ossec.net/
The rails error management landscape has changed a lot since this question was first posted. But this thread came up when I was doing google searches for airbrake alternatives.
Several new companies have started offering error monitoring services for rails. The one we like at work is Honeybadger.io. Paper trail is also a nice service in this space.
Another option for error tracking and monitoring in Rails is Raygun, at http://raygun.io - it's got the usual complement of features like intelligent email notifications and error grouping, but adds nice organisation support for multiple devs and integration in GitHub, Fogbugz, YouTrack etc. It's also got Hipchat notifications so when an exception occurs your team sees it in your chat room.
Installing and setting up the ruby gem (https://rubygems.org/gems/raygun4ruby) into your project's pretty quick, too.
One wonderful way to get updates about your application is to use Exception Notification.
This allows you to get emails based on exceptions that take place in your app. It won't be a solution to all of your information desires, but if someone tries to access a non-existent page, you could get information about what they tried to access, how they got there, etc.
Hoptaud and Exception Notification are good, Heroku has another addons to use like StillAlive.
FogBugz and LightHouseApp may also help you, Lighthouse is free for open-source.
If you want to get involved deeply in Rails errors and notifications read The Rails 3 Way book's first chapter and /environment folder's content.
The best way is still BDD and TDD. Work out all redirections, add nice 404 page, use all stages for development (devel, test, hopefully staging and QA too, and only finally production), then get notifications and always check logfiles before going for production. HTH
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have been interested in learning Rails for some time now and feel now is as good as time as ever to dip in and actually get my hands dirty. I've spent the past week reading every free ebook on Ruby and Ruby on Rails I can find. I just finished reading Ruby Essentials. I have also been playing with http://tryruby.hobix.com/
I have installed Ruby, Rails, MySQL, PHP, phpMyAdmin on a Windows XP machine, I also have access to a Ubuntu machine.
I come from several years of PHP experience and around a year using CodeIgniter.
What I would really like now is a fairly basic Rails app that is a little more in depth than Hello World but not quite up to par with say a forum or blog.
I find its much easier to learn how something works when I can play with already made code and do some trial and error changes.
What I am really looking for is that 'Ohhh, I totally understand now!' moment I had when I first started learning PHP.
Does anyone have an app or know of one that could possibly provide that moment?
Check out the screen casts on Rails at BuildingWebApps . I've watched several and they have been exactly what I was looking for when learning rails. They start simple and keep adding more and more functionality. The commentators move at a good pace and subscribing to the lessons is free.
If you want something that is built already build the sample application that comes with Agile Web Development on Rails, buy the pdf from pragprog.com, the latest version is set to work with Rails 2.2, so will work with 2.3 as all the basic features of the framework will be the same.
When you are ready to move on from that, the Rails Guides website is all new and is a great resource for all developers new and old.
dwc is right though, a blog is a good thing to start on your own, so when you are confident give it a go, even if you don't put it in production it will help you along.
I would recommend railsforphp.com. They have a PHP to Ruby reference which could be quite helpful.
You can also buy the 'Rails for PHP Developers' book as either a paper or digital copy (or both if you really want to). The book is full of examples that show the PHP way and how it compares to the Ruby/Rails way.
As for ready made code, I suggest having a play with Enki. It is a somewhat bare-bones blogging system that should give you a good testing ground.
You should rethink your idea that a blog is too complex. At it's simplest a blog is a textarea and a submit button, and then storing and regurgitating the results. Start with that to get your hands dirty, then add features as you go. In fact, why not practice some Agile and do your own iterations?
The Rails Guides are nice http://guides.rubyonrails.org/
If you don't like the blog idea, you could make a wiki, this isn't very complex either. you simply need a edit button on every page with the text from the linked to it. This will teach you how to handle rails and play with ruby for things like regular expressions and such.
Take your time, break down these problems and and they should be easy for you to solve with rails.
And go on IRC (server freenode channel #rubyonrails) you can use MIRC for that. Ask questions there, I usually am there, (look for nims).
My suggestion would be to start with a simple CMS. This is something you can continue to use and expand as your skills progress and you start other more complicated projects. In the most basic form, this consists of a Page model, and a Topic model. You could then add a User model, some login capabilities and a simple admin interface. After all, Rails was originally envisioned to make it easy to CMS type sites.
As you get this up and running, you can add some plugins to extend the functionality to include tagging, comments, and more. Or you can roll these capabilities yourself.
Set up an account on Github and learn how to use Git. Its great, and better than what you used before (if anything.) You should also learn rake, and capistrano, as these are huge timesavers and work hand in hand with Rails and Github.
http://blog.caboo.se/articles/2007/4/11/sample-rails-application
http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html