The use of Ruby on Rails in Linux can make it easier to maintain and develop Web applications, allow developers to focus more on the logical structure of the system, and configure the Ruby on Rails development environment before use, and the following small series will introduce Ubuntu 12.04 How to configure the Ruby on Rails development environment.
Ubuntu 12.04 + Ruby 2.0 + Rails 3.2.13
1, the installation system needs the package
$ sudo apt-get install-y build-essential OpenSSL curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev li Bssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev Libpcre3-dev Libsqlite3-dev Libmysql-ruby Libmysqlclient-dev
2. Installation RVM
After the installation RVM succeeded,
Then, load the RVM environment (the new open termal do not have to do so, will automatically reload)
$ source ~/.RVM/SCRIPTS/RVM
Check to see if the installation is correct
# Install ReadLine Package $ RVM pkg Install ReadLine
# Install Ruby 2.0.0$ RVM Install 2.0.0--with-readline-dir= $RVM _path/usr
4. Set Ruby version
$ RVM 2.0.0--default
Test is correct
$ ruby-v
Ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
$ gem-v
2.0.0
5. Install Rails Environment
$ gem Install bundler Rails
Test installation is correct
$ bundle-v
Bundler version 1.0
$ rails-v
Rails 3.2.13
6, install MySQL
$ sudo apt-get install mysql-server mysql-client//Keep in mind the password entered during installation $ sudo apt-get install libmysql-ruby Libmysqlclient-dev
$ gem Install MYSQL2
View Gem Package gem list
The above is the Ubuntu build Ruby on Rails development environment Introduction, need to install RVM, install ruby Environment, install rails environment, install MySQL finally.