ArticleDirectory
- 1. Install the Ruby interpreter
- 2. Install the rails programming framework
- 3. Install passpsenger and nginx
If you want to learn rails without MacProgramFor members, Ubuntu is the best choice. Unfortunately, the UBUNTU World lacks the legendary text editor textmate and, in fact, the best image editor Photoshop, fortunately, Emacs and gimp have completely met all the needs of my lame programmer and amateur artist. Don't worry, we are not alone at all, because Sam Ruby, a collaborator of agile web development with rails, is also using ubuntu.
Installing the rails Development Environment on Ubuntu involves three steps:
- Install the Ruby interpreter;
- Install the rails programming framework;
- Install the Rails Web server.
These steps are actually very simple. I don't know why the instructions on the Internet are so complicated. Let's get started!
1. Install the Ruby interpreter
The C language compiler is required during the installation process. We will install a full set of compilation tools while installing Ruby.
$ Sudo apt-Get build-essential
$ Wget http: // http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
$ Tar xvzf ruby-1.9.2-p0.tar.bz2
$ Ruby-1.9.2-p0 CD
$./Configure-Prefix =/usr/local/Ruby # specify the installation path
$ Make & make install
$ Sudo ln-S/usr/local/Ruby/bin/Ruby/usr/bin/Ruby
$ Sudo ln-S/usr/local/Ruby/bin/gem/usr/local/gem
#1.9.2 the package contains rubygems and you do not need to install it yourself. You can check whether Ruby-V and gem-V have been installed successfully.
2. Install the rails programming framework
The rails framework is written in ruby, so we use the rubygems Package Manager to install it.
$ Sudo gem install rails
When developing a rails program, we also need to use the SQLite database.
$ Sudo apt-Get install sqlite3 libsqlite3-dev $ sudo gem install sqlite3-ruby
3. Install passpsenger and nginx
$ Sudo gem install passenger
$ Passenger-install-nginx-Module
# There are prompts for each step. Follow the prompts.
After the installation is complete (my installation in the/usr/local/nginx directory)
$/Usr/local/nginx/sbin/nginx # Start nginx
$/Usr/local/nginx/sbin/nginx-s stop # Stop nginx