How to Run Ruby on Rails Applications on a Windows Box

Is there anyway to run Ruby on Rails applications on a Windows box?

Windows is not the usual place to deploy production Rails apps, but there are people who do it. Mongrel was originally written to give better deployment options for Windows. As it turned out the UNIX deployment options weren't that good either. :)

Start with the Ruby One Click installer so you have a sane installation of ruby and rubygems.

From there, you install the rails gem and the gem for your database like you normally would. Most if not all of the databases have Windows gems.

Make sure to install mongrel_service to be able to control each mongrel like a normal windows service. See mongrel_rails service::install -h for details.

Once you have your mongrels set up, it's similar to a UNIX deployment. You set up a reverse proxy, such as Apache2 and you're set.

You might run into some gems (such as BackgroundRB) that will not work under Windows because they have C code that either rely on UNIX libraries or expect a UNIX-like build system at installation time. However, all of the really important Rails gems, such as Mongrel and the database adapters, have gems with pre-built binaries available, so you'll be fine.

How to run already complete Ruby on Rails application in Windows?

  1. Ensure you have bundler installed:

gem install bundler


  1. cd to your application directory

cd path\to\application


  1. Run bundle install - this would install all the dependencies that are required to run the rails application.

  2. Ensure that you have the database installed/configured. Check config\database.yml for development settings.

  3. Run rake db:create db:migrate db:seed - this would create your database schema, add seed data.

  4. Finally, run rails server.

Can't Start Rails Server in Windows

You need to create a rails app and change into that directory before you can run the server. Try this:

rails new commandsapp    # the name can be anything you want
cd commandsapp
rails server

"rails new " creates a new folder with the default rails layout (app, db, log etc).

Ruby on rails application in Windows Azure Virtual Machine

The problem is you haven't actually "deployed" anything. You just copied your rails app to a VM and ran rails s.

A production rails applications is not deployed in this fashion.

Consider using either nginx with unicorn or apache/nginx with passenger.

How to deploy a rails application on Windows PC (windows 7 / windows 8)?

Take a look at Vagrant, which is a highly scriptable VM host. You can then generate batch files to automatically start the VM on boot.

To deploy new code, you'll just want to provide them with a new VM image they can copy into your app directory.

That said, I agree with other comments that this might not be the right platform for your use case. The main reason for building web apps is so that many clients can use your app over the web using just one set of servers. Deploying a web server to each client seems like it's defeating that advantage.

How to run 'rails credentials:edit' on Windows 10 without installing a Linux Subsystem

I would suggest you switch to non-windows based system if you're trying to do any rails development as I used to work on a windows machine until I caved in and switched entirely to Mate Linux. It would be so much easier to develop Rails application on Linux platform since you would see almost all gems compiling without any issue and all the rails terminal commands are working without further setup.

However, if you would like to edit your credentials, you need a text editor (Usually vim on Linux) setup before running credentials:edit.

First run SET EDITOR="notepad_path" and then try running rails credentials:edit

You can change notepad_path to any other text editor you prefer. However, some editors like Atom was giving weird issues for me.



Related Topics



Leave a reply



Submit