简体   繁体   中英

Deploying Rails app to a VPS

I've been building my first site using Rails, and I want to get it live. Up to now I've only ever put a site live by just dropping all the files onto my VPS via FTP, and I know that's not how it works with a Rails app.

What I don't know is where to even begin with making sure Rails is installed on my VPS (it's Linux based, I bought a package from Webfusion), and then how to deploy it and get it all running properly. My VPS has Plesk 10 installed on it, and from what I've read I need to install Rails alongside Plesk? I may have the wrong end of the stick, so don't hold back if I'm saying stupid things.

I realise this is a really green question to ask, but I've scoured forums looking for a solution I can understand and come up with nothing, so hoping someone here can help.

Thanks in advance!

I've never used a control panel like Plesk but I do have a VPS at linode.com. To get my rails sites up and running I got help from a smashingmagazine blog post and pro railscast episode . The railscast episode is not free but it has great info.

There are a lot of details with each step of getting a rails web server running on a VPS so please look at the blog or railscast video. But a high level overview of the steps is:

  1. install rvm
  2. install ruby and ruby gems
  3. install rails
  4. install a rails web server (a common option is passenger and nginx)
  5. install a database (postgres is a common option)
  6. capistrano for deployment

I wrote an ebook an this topic. After explaining how to set up a server from scratch it focuses on how to deploy an application manually, helping you to understand how this process works under the hood (I left automation out intentionally).

It covers a nginx/Unicorn/MySQL/rbenv setup. If you think that's something for you, you can get it here (it's free for people on my mailing list).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM