Jul
13
2010

Creating a Rails 3 app without the ‘rails’ command

Following my previous post about Rails3 and RVM (and for my own future reference), you can create a new Rails 3 application without having installed Rails previously. To do this, you rely only on Bundler and a Gemfile.

All you have to do is, create a directory for your rails application and inside that directory, create your Gemfile with the gems you need, including Rails 3.

source 'http://rubygems.org'

gem 'rails', '3.0.0.beta4'

Now all you have to do is run these two commands, to install the gems and create your application:

$ bundle install vendor/bundle
$ bundle exec rails new . --skip-testunit --skip-prototype

Just remember that the Rails command will try to overwrite your Gemfile, so make sure you answer ‘no’ to that question.

A very big thanks to Eduardo for this tip!

Related Posts

About the Author: Pedro Sampaio

I'm an UX Software Engineer at FARO Technologies, in Portugal. I work mainly with .NET technologies, such as WPF, during the day. Off work, I develop web application in Rails. I also have experience with ASP.NET MVC, Test and Behavior Driven Development, and agile methodologies, namely Scrum.

Leave a comment