Self-built http://commando.javaeye.com/blog/297918
Set up the ROR development environment as follows.
1. Install netbeans6.5
Netbeans6.5 download address http://zh-cn.netbeans.org/download/6.5/ml/
You can download a single Ruby version, which is about 50 MB.
2. Establish a ruby Environment
Address http://rubyforge.org/projects/rubyinstaller/ for installing RUBY: one-click installation package
Install rails: Gem install rails -- remote or gem install rails -- include-dependencies
View the installed version:
Java code
- Gem-V;
// My version 1.3.1
- Ruby-V; // my version 1.8.6
- Rails-V; // my version 2.2.2
Gem-V; // my version 1.3.1 ruby-V; // my version 1.8.6 rails-V; // my version 2.2.2
3. Some useful commands
1. If you want to study the demo program depot in Agile web development with rails, you need rails1.2.6. The following command may be used:
Java code
- Gem uninstall rails
// Uninstall rails
- GEMS install rails-v 1.2
.
6
// Install a specific version of rails (Depot)
Gem uninstall rails // uninstall rails gem install rails-V 1.2.6 // install a specific version of rails (Depot)
2. Currently, the maximum value of GEM is 1.3.1. If you use 1.1 or 1.2, you want to upgrade it:
Java code
- Gem update -- System
// Method 1
- Updating rubygems
- Nothing to update
- // The above error may occur. You can solve this problem by installing the following method:
- Gem install rubygems-update // method 2
- Update_rubygems // method 2
Gem update -- system // update method 1 updating rubygemsnothing to update // The above error may occur. You can solve this problem by installing the following method: gem install rubygems-update // upgrade method 2 update_rubygems // upgrade method 2
4. Try it out
Java code
- User> CD work
- Work> rails demo // create the demo program skeleton
- Demo> Ruby script/Server // start webrick Service
- // Input in the browser
- Http: // localhost: 3000
User> Cd workWork> rails demo // create demo program skeleton demo> Ruby script/Server // start webrick service // enter http: // localhost: 3000 in the browser
If you see the following picture, congratulations!