Easiest way to deploy to VM?

52 views
Skip to first unread message

j...@via.net

unread,
Aug 13, 2018, 12:17:46 AM8/13/18
to Ruby on Rails: Talk
I have a rails site that I have developed on my MAC. I have a Xen server that I want to spin up a VM and run the site on.
What's the easiest way to get the site from my MAC to the Xen server and run it with a real web server - not webrick.

Thanks,

Joe

Hassan Schroeder

unread,
Aug 13, 2018, 10:55:47 AM8/13/18
to rubyonrails-talk
Wow, how old is this app? I think puma has been the default Rails
server since maybe 4.2? Or at least 5.0...

Regardless, most people deploy via Capistrano. It can be a little bit
fiddly to set up but once configured it's as simple as `cap deploy`.

HTH!
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

j...@via.net

unread,
Aug 13, 2018, 1:07:16 PM8/13/18
to Ruby on Rails: Talk

Hah! I've been noodling with this for a couple years. It's Rails 4.2.1...
Thanks for the advice.

Joe

Hassan Schroeder

unread,
Aug 13, 2018, 2:06:52 PM8/13/18
to rubyonrails-talk
On Mon, Aug 13, 2018 at 10:07 AM, j...@via.net <j...@via.net> wrote:
>
> Hah! I've been noodling with this for a couple years. It's Rails 4.2.1...

You can certainly use Puma with that version (in development as well),
but in the meantime I'd recommend upgrading to the last 4.2.x version
for the security fixes if nothing else.

(https://www.cvedetails.com/vulnerability-list/vendor_id-12043/product_id-22568/Rubyonrails-Ruby-On-Rails.html)

HTH,

j...@via.net

unread,
Aug 15, 2018, 5:21:52 PM8/15/18
to Ruby on Rails: Talk
Ok, so what's the easiest way to upgrade my rails 4.2.1 project to 4.2.10?

joe

Hassan Schroeder

unread,
Aug 15, 2018, 5:51:21 PM8/15/18
to rubyonrails-talk
On Wed, Aug 15, 2018 at 2:21 PM, j...@via.net <j...@via.net> wrote:
> Ok, so what's the easiest way to upgrade my rails 4.2.1 project to 4.2.10?

Edit your Gemfile entry for Rails and run `bundle install`. If all your
tests still pass you may want to fix any deprecation warnings just in
case you decide to upgrade beyond that (recommended).

You can also run `bundle outdated` to see what gems you might be
able to bring current.

j...@via.net

unread,
Aug 15, 2018, 7:23:00 PM8/15/18
to Ruby on Rails: Talk
Can I run puma in production or do I ned to setup nginx?

Thanks!

Joe

Hassan Schroeder

unread,
Aug 15, 2018, 7:35:14 PM8/15/18
to rubyonrails-talk
On Wed, Aug 15, 2018 at 4:22 PM, j...@via.net <j...@via.net> wrote:
> Can I run puma in production or do I ned to setup nginx?

Having a separate proxy like nginx or Apache httpd in front of your
app server (puma, unicorn, etc.) is definitely recommended.

A proxy can more efficiently serve static assets, handle your SSL
termination, redirect http -> https, return a static "sorry" page for
maintenance, drop obviously bogus requests (e.g. "admin.php"),
split requests to different applications based on the URL, etc., etc.

I've never run an app in production without one so ¯\_(ツ)_/¯

HTH,

j...@via.net

unread,
Aug 16, 2018, 6:32:23 PM8/16/18
to Ruby on Rails: Talk
If I do that, will it blindly overwrite files that I've modified like the routes file?

Joe

On Wednesday, August 15, 2018 at 2:51:21 PM UTC-7, Hassan Schroeder wrote:

Hassan Schroeder

unread,
Aug 16, 2018, 6:38:29 PM8/16/18
to rubyonrails-talk
On Thu, Aug 16, 2018 at 3:32 PM, j...@via.net <j...@via.net> wrote:
> If I do that, will it blindly overwrite files that I've modified like the
> routes file?

1. No
2. It wouldn't matter because _of course_ you're using Git*, right?
* or comparable source code control system

And if you're not -- start now before you do *anything* else :-)

Rob Jonson

unread,
Aug 17, 2018, 6:50:59 AM8/17/18
to Ruby on Rails: Talk
I'm a recent huge convert to HatchBox. I used to manage my own server with a Chef script to set up and rebuild in case of problems, and use capistrano for deployment.

Now I just let Hatchbox handle it. 

They'll set up nginx, ssl, set up your database, action cable, redis, etc, etc

Then they take your code from git, do the whole install and everything just works. It's a lot like heroku - but with your own servers.
You can point them to your own VM (they need ssh access) - or frankly I'd just spin up a digital ocean server to handle the job.

Hatchbox is $15/month, and you can get a pretty good server from Digital Ocean for the same.
$30/month saves a lot of hassle

when you release an update - you just push it to your master branch in git (or whatever branch you choose) and it updates automatically.

read more here

(remove the via=rob if you don't want me to get a commission on signups!)
Reply all
Reply to author
Forward
0 new messages