1. Install Ruby
After the installation is successful, the input ruby-v will have version information
2. Execute gem install rails installation Rails
Implementation of the outdated wait, long time no response, after the internet to find out the resource is not found, the solution is to modify the configuration source
Configuring with the Gem Source command
Change http://rubygems.org's gem to http://http://ruby.taobao.org
Finally, make sure to keep a valid source
----------------------
Show sources currently in use
Gem sources
Add a source
Gem sources-a URL Address
Delete a source
Gem sources-r URL Address
Update Source Cache
Gem Sources-u
-----------------------
Finally use RAILS-V to see if the installation was successful
3. Next, execute the Rails new project name to create a project
Rails New Blog
4. Execute Rails Server
Open the service, you need to install a lot of third-party packages, GCC, gcc_c++, SQLite
Enter http://localhost:3000 in the browser to see the blog you created.
5. Execute rails Generate Controller Welcome index
After modifying the home page in Config/route.config and then re-opening the service after adding content to the view
Because there is no graphical interface under CentOS, the use of elinks, the effect of general-like!
The final result is as follows:
Build Ruby on Rails environment under CentOS