Ruby on Rails: Reload Script/Console Without Restarting

Home -> Programming -> Web -> Ruby on Rails

4783 views

From the computer of: johnnythawte (22 recipes)
Created: Dec 06, 2006     Updated: Dec 07, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

When you are testing your rails application using script/console, you have to stop and start the console to test changes to your model objects. This recipe shows you the easy way to reload the console.

If you are using windows, you start the console by using this command:

ruby script\console

Linux:

./script/console


Just use the following command whenever you make changes to your model objects:

reload!


Here's an example:

?> reload!
Reloading…
=> [Article, User, ApplicationController]
>>

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Using Tagging in your Ruby on Rails Application
  Install Ruby on Rails on Ubuntu Linux

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.