About ruby on rails, hackintosh, iphone3g and etc.

Thursday, November 19, 2009

Rails Model Generate and Destroy

Sometimes for beginner's to Rails, generating model and not knowing how to delete or remove the unwanted model.

To generate a model called cart:

script/generate model cart

To remove this model called cart:

script/destroy model cart


Tuesday, November 17, 2009

Cannot install rails. Set that proxy.

If you are installing gems or rails over a proxy, you may encounter the following problems.

Remember to set your proxy first as below:

In Windows:
gem install rails
ERROR: http://gems.rubyforge.org/ does not appear to be a repository

Before we begin, if you are behind a proxy, open the command prompt and give the following command:

 >Set HTTP_PROXY=http://:

For example, if the address of the proxy server is 192.168.1.1 and the port number is 9090, then you would have to give the following at the command prompt:

 >set HTTP_PROXY=http://192.168.1.1:9090 

Next, give the following command at the prompt:

 >gem update