The installation environment on rails on Ubuntu has been installed many times, and many problems are encountered each time. This time, the installation steps on Ubuntu12.04 are recorded, saving the trouble of installation later. first, install g ++ ubuntu without installing this, which is installed to compile and install the software apt-getinstallg ++ 2. install rvmbash & lt; (curl-shttps: // rvm.beginrescueend.com/I
The installation environment on rails on Ubuntu has been installed many times, and many problems are encountered each time. This time, the installation steps on Ubuntu 12.04 are recorded, saving the trouble of installation later.
1. First, install g ++ ubuntu without installation.
Apt-get install g ++
2. Install rvm
Bash <(curl-s https://rvm.beginrescueend.com/install/rvm)
Configure the file. bashrc in the root directory of the user.
Add one sentence at the end
[[-S "$ HOME/. rvm/scripts/rvm"] &. "$ HOME/. rvm/scripts/rvm"
Run the following command to make the configuration take effect.
Source. bashrc
3. Install RUBY
Https://rvm.io/rvm/install/
There are commands to install
4. Install rails
If you use gem intsll rails directly, an error may occur.
ERROR: Loading command: install (LoadError)
Cannot load such file -- zlib
ERROR: While executing gem... (NameError)
Uninitialized constant Gem: Commands: InstallCommand
This should first download the installation zlib1g-dev
Sudo apt-get install zlib1g-dev
Then re-compile zlib In the ruby source code.
Take my installation directory as an example. Go to the following path and adjust the path based on the installed ruyb version.
~ /. Rvm/src/ruby-1.9.3-p194/ext/zlib
Run commands
# Ruby./extconf. rb
# Make
# Make install
Then install rails with gem.
OK rails Development Environment installation is complete.