(Rails newbie) How to deploy a ruby on rails application to Droplet? - ruby-on-rails

I currently created a droplet with Digital Ocean and I am having trouble understanding how to deploy my ruby on rails application.
I used DO one click option and that gave me a folder called rails_project. I currently have my rails application on github and plan to clone the repository to the root. Can I delete rails_project once I have my app on there?
Is there anything else I need to do?
Thanks!

I'd check the rails_project app for database.yml to see how they connect to Postgres, but according to the tutorial, all the software you need should be installed.
I use capistrano to deploy to DigitalOcean, but if all you need to do is git clone / git pull, you should be fine.

Related

How to deploy a rails project on a Ubuntu server?

I've developed my Rails project locally and want to deploy it on my Ubuntu VPS. Now I've installed the gems on the VPS and copied my Rails App code to it. I can execute rails s --binding=0.0.0.0 in a putty session to the VPS and the website can be access from the Internet. The problem is when I close putty, the website is down. How to start my Rails App in a way that it still alive even if I closed putty?
Using rails s is not the way to go. It will use Webrick(or a different one if you choose) to handle the requests and it can be quite slow.
You should setup a production stack for serving your website.
Here is one of the best tutorials I've seen about how to deploy a Rails app to a production server(VPS).
In short you gonna need install RVM or Rbenv, Ruby, some libs, Database, Nginx and Passenger. You have alternatives too. But this is the basic.
I recommend using Capistrano for deploy. You can choose another deployment tool also, or none.
rails s it is best for development only.

Cannot fork an older heroku app

I have a ruby on rails app on heroku that I wanted to make some updates to. I was hoping to fork the app and test my changes on a new staging clone before I update the live site.
When I try the command:
heroku fork -a source-app new-staging-app
I get the error:
! 'fork' is not a heroku command.
And when I use "heroku help", fork does not appear as one of the choices.
When I'm signed in to another account and working on a more recent app, the fork command is available as a command.
The app I'm trying to fork is on the cedar stack and it's currently using rails 3.2.11.
Any idea why 'fork' might not be available with this app?
The 'fork' command was added to the heroku toolbelt in 2013. Install the latest version of the heroku toolbelt on the account in question to be able to use the fork feature: https://toolbelt.heroku.com

Is there a easy way to deploy ror on windows?not a development environment

There are many guide help us to deploy ROR on windows for development.
How can I to deploy a ROR evironment for production.
The InstantRails project doesn't update anymore,and I don't know is it can be use for regular production?
Try the installer found here for Ruby- http://rubyinstaller.org/
Just don't install the dev kit add on. Then install the gem manager (same page) and do gem install rails. That should get you stated.
-Will

Correct way to set up Rails environment?

Thanks Tilo for your response. I will try to ask a better question.
I need to set up a Ruby on Rails Production environment that will only be used to host RoR applications and will be used as a Git server too. There will be no development done to these applications on the Production server. Right now, I forsee the production server hosting a maximum of 5 to 6 applications only. A couple will be company internal only and the rest of the apps will be viewable to the public. The traffic that they will receive is about 12 to 20 hits per week.
I have been given access to a Virtual Machine that will be the Production server and is currently running Ubuntu 10.04 LTS, Apache2, MySQL, and Passenger. There will be two RoR developers using the Production server to host their applications.
My Development Environment of which I am running Ubuntu 10.04 LTS, Apache2, and MySQL on my own laptop looks like this for each project/application:
RVM installed per application, Git,
Ruby 1.9.2 installed thru rvm, Rails
3.0.3, and I have yet to install the Capistrano gem.
My question is I don't understand how to host a RoR application on our production server.
As an example of what might be done to host a RoR application: I am surmising that I will create a user called app1 under the home directory. Next, should I install Ruby system wide or should I install rvm for app1 and then Ruby for app1? What are the steps involved on how to set-up the environment to run an application on a production server?
Can you give me a few setup scenarios, please?
Thanks in advance.
You didn't tell us what you want to use this web-site for... is it company internal only?
just a few users? or is it externally facing the internet? Just one server running everything?
If it's facing the internet, I would certainly stay away from Ubuntu... look at CentOS/RedHat or FreeBSD to install on a production server.
I'd definitely use Capistrano for deployment. Definitely Git.
I would definitely not install RVM system-wide - IMHO it is not robust enough.
I emailed with Wayne Seguin (maker of RVM) and he also uses the method I've outlined in the post below,
using one dedicated deploy user:
For how to deploy ruby-versions and gems with RVM, look at this post:
Installing Ruby offline using rvm
If you really need two versions of Ruby for two different apps, then use two deploy-users!
Each of them has their own default-ruby-version(!) that's why you really need two users :)
and you can install / manage the gems for each project separately under each of the deploy accounts.
You should also put the git repository in each of the accounts, so you can test.

How to launch a rails 3 app on Heroku?

How do I launch a Rails 3 app on Heroku.
I am using PHPmyadmin.
I would start here
yep, you need to read the manual. Heroku is entirely managed system, you can only deploy via a git push. By default it uses Postgresql as it's DB - you can use mySQL but you'd have to pay for an Amazon mySQL server
Perhaps you should read through the Ruby on Rails tutorial. It guides you through the process of developing an app in RoR and pushing it to Heroku. Good luck.
This part, especially, has information on deployment to heroku:
Heroku Deployment

Resources