Version Control and Deploy Rails Project with cPanel - ruby-on-rails

In my server, what option i got is a basic unlimited server can host unlimited rails project
possible to manage gem because it is using cpanel latest version with a ssh
now my confuse is ,
how can i use the no ssh feature in the cpanel and ease my deployment ?
i don't know is that possible to use the capistrano and git with it
any guidance for this ? to make it possible to update with git push feature
i never deploy anything before ,
i tried to use heroku but i don't know why many user can make their file fit the 5mb space...
my project is now 30% at progress but the space used was 14mb...
so, i bought a cheap standard web server with cpanel . any one could help me in this case ?
usually how you guy deploy and where you deploy ?
recently one guy gave me a link for the github deployment, is that possible to make github use in the cpanel server ?
i mean like host and push the file into github and then link to the personal server ?
anyway, thx for person who reply me recently ^.^
i just develop for hobby...any cheap rails server suggest ?
Thx a lot for reply~

You could also try heroku (www.heroku.com) as a hosting platform. It has a simple deployment workflow that uses git.

Unelss you've done it already, you'll need to install git on your local machine.
Here's a bit about capistrano too.
Capistrano is basically a series of scripts (that you run from your local machine) that get your code and put it on your web server(s). You can configure capistrano to either check out your code from git on the production server, or to copy your code from your local machine.

Related

deploying a rails project to a remote server

is it possible to deploy a rails project to a remote server using FileZilla ? the server is running nginx/1.4.6 (ubuntu)
if no what is the best way to deploy the project if there is already a running version !
To answer your question yes, the code needs to be up, so FTP should do the trick. You might need to restart nginx to pick up the changes, usually touching a restart.txt is enough, but that's particular to your setup.
Is this the best way? Possibly not!
Others suggested capistrano and that would be a good fit for a server you maintain, or go Heroku (or similar) service for a simpler setup.
Deploying a Rails app is a tough job. There is always the easy way (heroku) however shared servers don't deal well with rails. Theoretically you can but usually this shared servers have really outdated ruby and rails versions and are absolutely useless. And you can try to connect via ssh and try to update it but i doubt you will be able to do that. So... If you are a rails developer i can suggest.
1- For small apps run Heroku (easy and free) however cost grows like hell with the app's growth
2- If you're thinking about developing big apps get a dedicated server (you can get cheap ones for 5€/month) and configure it as u would for your computer except when you run rails you run it in production.
3- Trust me... i fought enough Rails and shared servers and i quit... I just gave up

deploy rails app digital ocean server

I am bit new to rails but somehow I manage to make an rails app.
Now I want to deploy it to Digital Ocean server.
All I got is
1- complete ruby on rails app
2- IP for digital ocean
3- Username
4- Password
can someone tell me steps to deploy it and which tools to use?
(I used fireFTP and Filezella for changing in some existing apps, but not sure that they are useful here or not)
Well, thats a good start as for what you have :)
You need certain tools to deploy on production. Here is what you need apart from what you have to deploy a rails app not just on digital oceans but pretty much on any server.
Capistrano: A deployment tool github repo
Nginx: A web server
Application server: Unicorn/Puma/Passenger - I use both unicorn and passenger
SSH access to you server
Mysql or any database of your choice to be setup on server
You should also use rvm to manage the rubies
Additionally, you might also want to manage your packages using chef
With the tools listed above and following this link you should be able to deploy the app on digital ocean
I would recommend that you install everything manually so you get the hang of it.
Hope that helps.

Ruby on Rails application deployment on local computer with postgresql

I am new to Ruby on Rails. We have developed an small application with Postgresql. Now we have to deploy it. But when i searched over internet i found lot of suggestion is to deploy them on Heroku or some premium servers. where we are not in a position now to deploy it on cloud.
How can i deploy the application on local computer? Is this similar to setting up a development environment?
Any link or lead will be much appreciated!
I hope you have your application already running on your development environment.
Create another database in your postgres, to use it for production in local system. And make necessary changes in database.yml
I feel passenger is the easiest way to deploy application, you can follow the steps in this link https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04 to deploy your app.
Heroku also have free deployment for few application. You can use heroku.
There are some more option like AWS, Digital Ocean. AWS is also free for one year.
Yes setting up a development environment is like set up your environment. But best practice is use a deployment automation like capistrano.
You can run it in a production environment and make it public. I had written a blog post regarding this.
Please check here
ps - Make sure your system is up for public access and i am hoping that this is for test purpose only and to show it to your clients.
Yes, it would be fairly similar to setting up your development environment.
In addition to setting up Passenger as described in the Digital Ocean post from Rajuk's answer, I use Capistrano for deployment to my Ubuntu servers. You can set up the Capistrano deployment configuration to deploy to any machine.
The possible configuration variables are too numerous to address here without further details about your specific situation.
Check out Railscast #335 Deploying to a VPS where Ryan talks about deploying to a Linux machine (a cloud VPS in this case) with Capistrano.

deploy a rails app with capistrano without a rails environment

I've been working on a rails project for a client that isn't technical. However, they want me to send over a deployment script, which their networks guys will use to deploy the application.
I've been using capistrano. But the problem is, cap is heavily dependent on the app itself. What i need is a script, that'd use the cap and config/deploy.rb but needs minimal setup on their local systems. The repo in the backbone is git based.
If this cant be achieved by capistrano, anyone knows of any other deployment utilities, that'd allow me stuff cap does and works independently? .. (i create symlinks and run some rake tasks in my :after_update block).
Thanks,
Hassan
If setting up a ruby environment to run cap deploy is not something that the "network guys" will be willing to do, then you're in for quite an uphill battle. Some suggestions to help alleviate this:
Have them use the railsready script to set up their environment
Give them a virtual machine (maybe a Vagrant box?) that can be used to deploy the instance
If you're doing a git-based deploy, you'll either have to set up a deployer key (and give this to them) or add them to your github project (assuming you're using github)
Consider bundling up the entire project and delivering as a tarball (or putting it into an rpm) and having them deploy this way (a quick&dirty way to do this is to deploy to a machine running the same distro as production, and tarring up the deployment directory)
Consider using a stack that more aligns with their network stack, like JRuby and warbler for deploying to Tomcat
Do some pair programming or at least screen sharing for the initial install. Sometimes the difference between loving and hating a platform comes down to the availability of help when problems arise.
Mina is like Capistrano but doesn't rely on being inside the rails application directory.
One option could be to setup something like Jenkins that will use capistrano to deploy. And your client can curl the jenkins build url to trigger a deploy.

How do you deploy your Rails application?

Do you upload your rail application to your host via FTP first?
I'm currently using Passenger and Capistrano. If I do "cap deploy" in my local machine then I think Capistrano should upload my rail application to my host, right?
Someone from my host is saying that I need to run "cap deploy" in server. I think it doesn't make sense.
You should be able to run cap deloy on your local machine and that should get the current version of your software to the server. However, you need to set up first how this is supposed to happen. I for example use Git to manage my code and also use it to get my software on the server. However, you could also use SVN or FTP if you prefer that. If you google for Capistrano together with the Software youbeant to transfer the code with and maybe even your hosting providers name, you probably will find a decent step by step explanation. For me John Numemaker's post on deploying with Capistrano and Git on Dreamhost really helped: http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/
As an alternative you also might want to check out heroku.com. Their smallest offer is free and enough for most projects. The deployment process is so easy a monkey could deploy a Rails app on their platform. I generally can only recommend heroku.

Resources