Recently, learning Ruby on Rails, development environment in the establishment of a time when a lot of problems encountered, their steps are now posted up tight for reference, to help novice are small detours; any inappropriate, welcomed the guidance; environment are as follows:
Operating System: debian, kernel: 2.6.18
Ruby: 1.8.6
Rails: 2.0.2
gem: 1.1.1
Database: mysql
Editing tools: vim
The following steps are the use of administrator privileges (root) users
2, set the debian source apt
Debian install and set up a good network to ensure that the system can access internet;
Update source settings: In / etc / apt / source.list add
deb http://debian.cn99.com/debian/ etch main non-free contrib
deb-src http://debian.cn99.com/debian/ etch main non-free contrib
Save run sudo apt-get update to update the list of installed packages, and then install vim
sudo apt-get install vim
3, the installation of ssh
sudo apt-get install openssh-server openssh-client
Objective: SecureCRT can use tools such as remote login Login debian
4, you will need to install the tools and rely on the library
Install gcc: sudo apt-get install gcc
Install build tools: sudo aptitude install build-essential linux-headers-$ (uname-r)
The installation of readline, zlib, libncurses5:
apt-get install zlib1g-dev
apt-get install libreadline5 libreadline5-dev
apt-get install libncurses5 libncurses5-dev
5, manually download, compile, install Ruby1.8.6
wget http://rubyforge.org/frs/download.php/18421/ruby-1.8.6.tar.gz
tar xzvf ruby-1.8.6.tar.gz
Directory after entering the decompression
. / configure-prefix = / usr / local / ruby # the ruby install / usr / local / ruby directory
make & & make install
To ruby by adding to the system PATH environment variable, edit / etc / profile file, in the post-page by adding:
export PATH = "/ usr / local / ruby / bin: $ PATH"
Re-sign-on system, run ruby-v, if there is similar to "ruby 1.8.6" indicates a successful installation
6, installation gem1.1.1
wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz
tar xzvf rubygems-1.1.1.tgz
Directory after entering the decompression
ruby setup.rb
Verify that the installation is successful: gem-v if there is "1.1.1", then the installation is successful
Update gem: sudo gem update - system
7, the installation of Rails 2.0.2
gem install rails - include-dependencies
- include-dependencies to install at the same time rely on the designated library
Verify the installation: rails-v if there is similar to "Rails 2.0.2", is illustrated in the installation is successful
8, the installation of mysql database
sudo apt-get install mysql-server mysql-client libmysqlclient15-dev
Initialization root password: mysqladmin-u root-h localhost password 'password'
Just installed mysql by default only allows local connection, if the remote connection, edit / etc / mysql / my.cnf, the bind-address = 127.0.0.1 and comment it out, restart mysqld
To ensure that the / var / lib / mysql directory owner is mysql.mysql
More mysql authorized other related issues please refer to the information
9, to install mysql-ruby driver
wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.5.tar.gz
tar xzvf mysql-ruby-2.7.5.tar.gz
Directory after entering the decompression
ruby extconf.rb - with-mysql-dir = / usr / bin
make & & make install
10, install the FCGI support ruby libraries
Install FCGI
wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar xzvf fcgi-2.4.0.tar.gz
Directory after entering the decompression
. / configure - prefix = / usr / local / fcgi
make & & make install
Ruby and then install the FCGI support library
wget http://rubyforge.org/frs/download.php/11368/ruby-fcgi-0.8.7.tar.gz
tar xzvf ruby-fcgi-0.8.7.tar.gz
Directory after entering the decompression
ruby install.rb config - - with-fcgi-include = / usr / local / fcgi / include - with-fcgi-lib = / usr / local / fcgi / lib
ruby install.rb setup
ruby install.rb install
To some, a simple RoR development environment to learn the basic set up, and finally can begin to experience the trip of RoR! After the above installation process, I believe that readers may judge the whole installation has been found to rely on other tools or methods of library, for example: svn, jdk, etc..







