# By default, rails console run in development env
rails server
# Run in test env
rails server --environment test
# Run in production env
rails server --environment production
Last time we have integrated the RSpec and Autotest in Rails 3.
Rails – Integrate Autotest and RSpec in Linux
But it seems that it takes quite long for RSpec to complete the tests. This is because RSpec reloads the entire Rails environment for each run. Spork Test Server helps you preloading the Rails environment which greatly reduces the time for running the test suite.
But i got some problems when i tried to setup the Autotest for the RSpec framework. Autotest is a continuous testing tool which run the test suite automatically based on the files you have changed. RSpec is a Behavior Driven Development (BDD) framework for Ruby. After a few hours of struggling, i finally made it work.
1. Create a new Rails project without the default Test::Unit framework.
I always wants to try Ruby but i didn’t determine to make it. Now i decide to create an Ruby on Rails web application as a learning goal.
So the first thing is to setup the development environment. As stated in the Rails documentation, there maybe some problems when running on Windows. so i created a virtual machine which is a Ubuntu Lucid and get everything ready there. Moreover, Rails 3.0 requires Ruby 1.9.2. So let’s start install the ruby first.