Rails deployment and hosting - reseller rather than DigitalOcean or similar - ruby-on-rails

I'm a little confused with how deployment of an application works.
I've been looking up tutorials and numerous times it is suggested that it goes live with DigitalOcean, Heroku or something similar, but some are monthly payment services (albeit not a large amount).
I resell hosting to my clients when I build websites for them so I manage everything on my side. My question is: is there a way to deploy a Rails app to my own web hosting space rather than having to use a third-party service? Have I missed something in the documentation?
I'm certain that my hosting can support everything that's needed. If anyone could explain how or why not I'd really appreciate it :-)

You can set up the stack on your own server without problems. When you are using apache or nginx, the easiest might be to use passenger for serving your rails application.
You just need to make sure you have the right ruby version and bundler installed. Services like DO are just simpler to work with as they already do all the needed server setup and most of the configuration for you.

Related

Laravel 5.1 application deployment

I have developed an application with Laravel5.1. Now I need hosting suggestion for deploying my application. I know it's a silly question but I want a reliable answer. Before buying a hosting I want to know which hosting service will provide proper environment to run a laravel5.1 application.
Php version required >= 5.5.9
This is such a hard question to answer as it all depends on what you're after.
Some questions to consider:
Do you want to set the server up yourself?
If this is the case then any unmanaged provider will do the trick, you'll just need to set it all up; LAMP, Git, Composer etc.
Do you want to manage the server itself but you aren't sure how to set it up?
Digital Ocean (and other providers I'm sure) offer one-click apps where you can deploy whatever you want. For Laravel you would probably want to pick the LAMP app install. These deploy all the packages you will require and set them up for you so that you don't need to - the rest of the server management would be up to you from there.
Do you want to use Managed Hosting where they do it all for you?
OVH have been pretty good for me in the past, I've never used their managed option, although I know they have it - and I've had great service from them too.
If you're still not sure then I would suggest looking for a provider that provides servers that come with a LAMP stack (as this covers everything you need for Laravel) or one that supports PHP applications - if you're not sure then just contact the company and ask. Or find someone (a friend or a professional) who can help you get started online.
One suggestion because you are using Laravel is to look at https://forge.laravel.com/ where you can handle servers that runs in Digital Ocean and other providers.
Fits perfectly for Laravel.

Hosting for Ruby (and Rails) like hosting for PHP

I was wondering if there was around a hosting as those that have existed for years for PHP that would give the opportunity to publish many Ruby and Rails applications and not as Heroku that forces a single application for dyno.
In classical hosting PHP I can create a folder, upload some files in php and navigate them through links.
You can something like that on some Web hosting?
For small projects, Heroku is really the best deal. Their free tier does everything you'd need for something that's occasionally used and doesn't have a lot of scaling issues. You are restricted to one application per "dyno", per account.
For anything more demanding it's not hard to set up a hosting environment on a VPS provider. Although it takes some additional knowledge, you'll be able to set up and configure a web server using a tool like Passenger and manage your own instances. For $10/mo. you can have a very capable server instance that will handle way more than a $7/mo. dyno can manage. Even the $5/mo. server from a provider like Digital Ocean is a fantastic deal.
PHP's fire and forget method of hosting is convenient, but it's actually a lot more work in the long haul compared to an efficient workflow based around Rails and Passenger.
For example, using Capistrano and a version control system like Git you can make changes, test locally, package up into a commit and deploy on your server within minutes. It's basically effortless once you get it working.
For small production projects, I use webfaction, it's easier to push to production than to configure a complete VPS as it's more like a managed hosting (with all the tools and documentation you need for rails) .
I use mina for deployment and Git for version control.
To complete #Tadman answer you can check OpenShift if you want a more Heroku like alternative.
When I started using Rails I was also tempted to compare and seek for a 'php-hosting' like solution. But it's just a different approach.
To answer your question more precisely, you don't drop files in a folder and navigate with links in a classic rails project. You have to understand the concept of MVC, routing ...
I suggest that you give the rails-tutorial a try, it is a good starting point for understanding the whole rails ecosystem.
You can try Ruby hosting on Jelastic PaaS with automated deployment to containers and scaling, as well as pay-per-use pricing model that makes it not so pricy.
There are pre-configured Apache and NGINX containers for running Ruby application, supported different Ruby versions, built-in Ruby on Rails framework, Passenger, Puma, Unicorn, Bundler dependency manager etc.
When deploying a Ruby application, only a single context (ROOT) can be used. However, you can switch between three deployment types: deployment, production and test.
More details are described here https://jelastic.com/blog/ruby-paas-hosting/
You can start with a free trial and test how it suits your project before investing any budget. This Ruby PaaS is available on different local service providers https://jelastic.cloud/

On Premise Ruby on Rails Application

I would like to ask you a question about deploying a rails application onto a physical server.
Briefly, our dinosaur client doesn't want to store anything on the cloud hence he wants us to deploy everything onto his servers instead of heroku.
What should be the most efficient way to solve this problem? Won't he be able to reach the source code of our application?
That would be great if you can help me,
Thanks!
You might think on the variant when you keep only production database (and assets if client want) on the client's server and deploy your code to Heroku or whatever else.

How can I deploy ruby on rails application to mochahost using capistrano?

I am new to ruby on rails deployment. I have created my first simple ruby on rails application, but I am struggling to properly get it onto my server.
In my research, I learned about the various ways to deploy a ror app to my own server, and it seems that using capistrano would be the way to do it. However, it is not clear to me how to use capistrano to launch my app.
What are the steps that I need to take in order to launch my app? Do I need to use git, I prefer not to.. I don't want to use Heroku.
It just seems that deploying the application should be really easy and I am struggling with it. If I am using the non-optimal tools let me know.
thanks
Capistrano is primarily used to deploy apps, not to launch them. Capistrano is of course capable of launching Rails apps, but how to do that depends on how your app is set up.
You should do some research on using nginx (HTTP server) and Unicorn (Rack server) together with Capistrano. It might take some time setting everything up, but once in working condition, they’ll make deploying your app close to enjoyable.
Regarding actually deploying your app: Heroku is not required in order to use Git, but if you really don’t want to use any kind of versions system (though I highly recommend that you do), this blog post might help you on your way: http://www.maxkpage.com/blog/capistrano-rails-deploy-without-svn-or-git/

Problems with Rails on Namecheap server

O. Community, and thanks in advance for the support!
I recently took Mattan Griffel's One Month Rails course on skillshare to be able to write rails web apps.
Railsinstaller.org includes rails 3.2.1 and ruby 1.9.3 and works perfectly out of the box.
My app worked well and it was time to get it up on the web, so I purchased a namecheap domain and webserver, uploaded my app and... nothing!
The problem is that the namecheap servers only support rails 2.3.17 and ruby 1.8.7 - nothing created with v 3.x or dependent on ruby 1.9.x will run in a 2.x / 1.8.x environment.
Has anyone else run into this issue?
It seems like such a standard use case, I can't believe it's not better documented on the namecheap site.
I've done my Google-Fu and have learned that, once I installed it, I could create an older rails app using
rails _2.3.17_ AppName
Is there a similar way of forcing rails to use an older version of ruby as well?
I'm close to cancelling my namecheap account altogether in disgust, so if someone out there knows of a better place to host my rails 3.x web apps, I'd love to hear about it!
(Let's assume, for the time being, that a VPS is prohibitively expensive and far in excess of what I need, resource-wise).
Thanks again,
One Frustrated User
You can use heroku free account to begin with. Don't waste time on fixing problems on shared hostings, they are just toys.
Rails 3.x native cPanel support is still unreleased , feature request case is still open
http://forums.cpanel.net/f145/mod_rails-passenger-instead-mongrel-rails-3-support-case-44197-a-152577.html
This is tricky but possible to run Ruby 3 applications - additional software installation and global server reconfiguration required in this case, but hardly possible on regular shared server per user. We can offer to upgrade your hosting account to VPS. All your existing account content including databases, additional domains, email accounts and settings will be transferred transparently to VPS. To optimize your VPS with cPanel and make possible for you to develop and run Ruby 3 application you may request our technical support team to tune up the system according to all your requirements. Operating system tuning and custom software installation is included with Full Management VPS option. You may request part-time technical support as an alternative.
Regards,
Dima S.
Technical Support,
Namecheap Hosting

Resources