Easiest way to deploy a Rails app (windows) - ruby-on-rails

I have a rails app that needs to be put online (anywhere) - I am using a windows machine, I tried to deploy it using Heroku but that was a huge pain. The app only needs to go online so I can show it to someone - It only needs to be up about a week, so setting up a Virtual Linux system on my windows laptop is not a preference for me.

It sounds like you need to follow a specific procedure to get Gemfile.lock to work for Heroku. This answer has some basic instructions: https://stackoverflow.com/a/21488679/693349
However, you'd probably do better to read the full Heroku docs about "Deploying a Ruby Project Generated on Windows": https://devcenter.heroku.com/articles/bundler-windows-gemfile.

Have you tried Digital Ocean?
https://www.digitalocean.com/features/one-click-apps/ruby-on-rails/
Normally deployment at heroku works like charm, what was the problem?

Try Capistrano gem. Is an especific gem to deploy Ruby on Rails projects and it works perfect!
You have a good tutorial here to configure Capistrano.

Related

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.

Deploying Ruby on Rails on Bluehost

Does anyone here know how to deploy a Ruby app on Bluehost? I am having quite a problem with this. Everytime I put my files inside the folder where my domain is pointing at, it always giving me a 403 error when I try to visit the website.
It's so painful. The instructions are incomplete. There are a bunch of things to get caught on like broken versions of sass, assets not pre-compiling, database configuring, how to restart the server, the root directory for passenger, etc.
I had problems with all of those things. I had to come here (Stack Overflow) to find most of the answers.
My site still runs in dev but not in production. The BH support is not much help. THey should call it BlueWordPressHost because that is who they are supporting.
Look in the <rails_root>/log directory for clues.
I'm not willing to switch over to Heroku and use postgres, I tried it but in reality your just dealing with another set of problems setting it up.
Give it a look -> Ruby on Rails Setup with Bluehost.
You cant just drop your Files in a folder.
Although Bluehost does a great job, i recommend you using Heroku for deploying Ruby on Rails Apps.
Deploying with Heroku is quite Easy -> Deploying with Git
I followed the instructions in the Ruby on Rails Setup as The Mini John referenced and it worked. They use Phusion Passenger to allow you to deploy any rack based application. However, I did have to manually install my gem dependencies. This is probably not a scalable solution for a production application with many users. However, if you already have bluehost as a hosting provider and are willing to maintain your own server and deal with possible latency issues and downtime, it may be worth it for you. Here is my Ruby on Rails 4.0 "Hello World" application deployed to bluehost: http://hello.getplanit.com.

Chef cookbooks to set up a Rails production server (CentOS)

So, I got tired of seting up production servers for my Rails apps all the time and decided to learn to use a tool that can simplify that process for me. I choose Chef-solo.
I've read the documentation and watched some tutorials, but I'm not realy sure I understend the process well, so I decided to go right to practice and learn on the way.
Now the real question: can someone provide me with a set of correctly working cookbooks to set up the server so I wouldn't need to reinvent the wheel myself?
OS - CentOS v.6.0-6.3
Software:
Development Tools (groupinstall)
git
Node.js
ImageMagick
Nginx and Unicorn
MySQL and PosgreSQL
Mail Server POP/SMTP/IMAP
RVM + ruby
MemCache
Think that's it.
Ofcource I need not only to install the packages, but also to configure them properly.
Any suggestions or additional info needed?
You can try looking at my repo at https://github.com/dmytro/chef-solo
I am using it to bootstrap Rails environments for myself.
Additionally it can be combined with Capistrano deployment. I use this in my capistrano recipes https://github.com/dmytro/capistrano-recipes
I've put blog post on these. Please lake a look too: http://dmytro.github.io/2013/05/21/easy_spawn_new_hosts_with_capistrano.html

Deploying a Ruby On Rails application

Once I've finished my Ruby On Rails app, I want to deploy it on a server.
What steps should I do?
Should I generate a file as for example a .war in Java?
Thanks a lot
Capistrano is the most popular way to deploy Ruby On Rails. Enjoy this screencast.
If you're deploying to regular server (non cloud) you can use the capistrano gem here's a good screencast on how to. If you want a cloud based service you can't beat Heroku.
You can follow this link.You will get a clear idea about Ruby On Rails app deploy
http://rubyonrails.org/deploy
Ideal and Easy way - you need to you best practices like
Version control with Git
Heroku Setup (which is free) (You can think for engine yard)
Here is the few links
Version control with Git
Deploying with Heroku
Link from Heroku
Please let me know if you need more information on this.

Rails application on shared hosting?

Is there a way that I can deploy my locally made rails app on a shared host that has Ruby installed?
Capistrano to deploy and (Mongrel or Passenger... preferably the latter... or if you HAVE to, FastCGI although FastCGI is pretty slow with Rails) to serve.
If you have a shared host you'll have to vendor your Rails version and all your gems, as you probably won't have access to install gems. Even if you did, you won't want Rails picking old versions of things.
Personally, I would use Capistrano. There are plenty of books and tutorials around that will tell you how to use it to deploy Rails applications. It is very easy to configure.
Dreamhost supports Rails, many others probably do also.
As for installation of your app: it depends a bit on what's already available on your shared host, and what you're allow to do / install / configure there. For Dreamhost, here's their documentation. Other shared hosting solutions may or may not be similar depending on their policy.
The best way I've found is to install the passenger gem. Once you've uploaded your app to your account all you need to do is add a few lines to your .htaccess file and you should be off.
Definitely capistrano + git (git, if you have SSH access, like f.e. in HostingRails shared host), nothing can be easier.
Neat Capistrano guide: http://www.linuxjournal.com/article/10100
How to config Capistrano + git: http://github.com/guides/deploying-with-capistrano
Some nice Capistrano recipes: http://github.com/josh/slicehost
Assuming your http server is nginx or apache, install Phusion Passenger
On the Passenger site, there are very good docs for configuring Apache/nginx with Rails
As a first step, just copy your Rails app somewhere to the host and get Passenger working
Once you have that working, you will need a better way to deploy/update the app; as others have suggested, Capistrano is a popular way to do it and you should have no problem finding some tutorials online to help you do it
I have done steps 1-3 and it is incredibly easy and works perfectly fine (I was just too lazy to do step 4).
Found a good reference : REFERENCE LINK this will help to deploy ROR App on a shared host.

Resources