Install Ruby, Rails, and Passenger in Ubuntu

Source: Internet
Author: User
Ruby $ sudoapt-getinstallrubyruby-devirblibopenssl-rubygem $ sudoapt-getinstallrubygems $ vi ~ /. BashrcexportPATH = "$ PATH":/var/lib/gems/1.8/bin $ source

Install Ruby, Rails, and Passenger in Ubuntu

Ruby

$ Sudo apt-get install ruby-dev irb libopenssl-ruby

Gem

$ Sudo apt-get install rubygems
$ Vi ~ /. Bashrc

Export PATH = "$ PATH":/var/lib/gems/1.8/bin

$ Source ~ /. Bashrc

Rails

$ Sudo gem install rails

Passenger

$ Sudo gem install passenger
$ Sudo/var/lib/gems/1.8/bin/passenger-install-apache2-module

Checking for required software...

* Gnu c ++ compiler... found at/usr/bin/g ++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at/var/lib/gems/1.9.0/bin/rake
* Apache 2... found at/usr/sbin/apache2
* Apache 2 development headers... not found
* Apache Portable Runtime (APR) development headers... not found
* Apache Portable Runtime Utility (APU) development headers... not found

$ Sudo apt-get install apache2-prefork-dev libapr1-dev libaprutil1-dev
$ Sudo/var/lib/gems/1.8/bin/passenger-install-apache2-module


Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module/var/lib/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so
PassengerRoot/var/lib/gems/1.8/gems/passenger-2.2.4
PassengerRuby/usr/bin/ruby1.8
...
Suppose you have a Ruby on Rails application in/somewhere. Add a virtual host
To your Apache configuration file, and set its DocumentRoot
/Somewhere/public, like this:


ServerName www.yourhost.com
DocumentRoot/somewhere/public # <-- be sure to point to 'public '!

Passenger apache settings

$ Cd/etc/apache2/mod-available
$ Sudo vi rails. load

LoadModule passenger_module/var/lib/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so

$ Sudo vi rails. conf

PassengerRoot/var/lib/gems/1.8/gems/passenger-2.2.4
PassengerRuby/usr/bin/ruby1.8

$ Sudo vi/etc/apache2/sites-available/yoursite


ServerName www.yourhost.com
DocumentRoot/somewhere/public
...

$ Sudo a2enmod rails
$ Sudo a2ensite yoursite
$ Sudo/etc/init. d/apache2 restart

Related Article

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.