Install ruby1.9.2 on ubuntu

Source: Internet
Author: User
Document directory
  • 1. Install the Ruby interpreter
  • 2. Install the Rails programming framework
  • 3. Install passpsenger and nginx
Ruby 1.9.2 + rails 10.4 Development Environment configuration in ubuntu 3.0

Ubuntu is the ideal choice for programmers who do not have a Mac but want to learn Rails. 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:

  1. Install the Ruby interpreter;
  2. Install the Rails programming framework;
  3. 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.

View sourceprint?
$ sudo apt-get build-essential
View sourceprint?
$ wget http://http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2 <br>
View sourceprint?
$ tar xvzf ruby-1.9.2-p0.tar.bz2
View sourceprint?
$ cd ruby-1.9.2-p0
View sourceprint?
$./Configure-prefix =/usr/local/ruby # specify the installation path
View sourceprint?
$ make && make install
View sourceprint?
$ sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
View sourceprint?
$sudo ln -s /usr/local/ruby/bin/gem /usr/local/gem
View sourceprint?
#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.

View sourceprint?
$ sudo gem install rails

When developing a Rails program, we also need to use the SQLite database.

View sourceprint?
$ sudo apt-get install sqlite3 libsqlite3-dev
$ sudo gem install sqlite3-ruby
3. Install passenger and nginxview sourceprint?
$ sudo gem install passenger
View sourceprint?
$ passenger-install-nginx-module
View sourceprint?
# 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

 

 

 

 

Comment

2058760

#1 floor [main poster]

View sourceprint?
1 Openssl Solutionnot Found problems
2 apt-get install libssl-dev
3 apt-get install libopenssl-ruby
4 cd ext/openssl
5 ruby extconf.rb
6 make && make install

View reply reference

#2 floor [main poster]

Initial appearance

No such file to load-zlib
###########################
Apt-get install zlib1g-dev
Apt-get install zlib1g

Cd ruby-1.9.2-p0/ext/zlib
Ruby extconf. rb
Make
Sudo make install
Sudo gem install rails
View reply reference

# [Main poster] on the third floor

Initial appearance

Rvmsudo passenger-install-nginx-module
The/etc/profile file is used.
PATH = $ PATH:/opt/nginx/sbin
Export PATH
REBOOT reply reference View

 

Original article in: http://www.cnblogs.com/viaivi/archive/2010/08/28/1811100.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.