Ruby

Iš Žinynas.
Jump to navigation Jump to search

Ruby on Rails diegimas supuvusiam senam Centos'e[keisti]

Turim 5.6 kentosa pas ji rubis yra per senas naujam gemsui ir tuo paciu paciam railsui su passengeriu taigi desim viska nestandartiskai i /opt ir turesim du rubius ;-)

is pradziu geriausia butu i /etc/profile paciam gale ideti eilute, issaugom ir tokia pacia parasom shelle, nu arba visa environmenta uzkraunam is naujo (source /etc/profile)

PATH=/opt/ruby/bin:$PATH

tada susikuriam koki /root/ruby nu arba /tmp/ruby kraut archyvam ir dedam visus stabilius bei reikiamus paketus (aprasyta su dabartiniais naujausiais patch'ais)

mkdir /root/ruby&&cd /root/ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.5.tgz

ispakuojam

tar xzf ruby-1.8.7-p352.tar.gz
tar xzf rubygems-1.8.5.tgz

toliau darom viska kaip priklauso

cd ruby-1.8.7-p352
./configure --prefix=/opt/ruby
make&&make install

wait...

cd ../rubygems-1.8.5
/opt/ruby/bin/ruby setup.rb
gem update --system 1.6.2

psio gemsus turim dabar reik idet rails butent 2.3.11 versija ant kurios dabar viskas dazniausiai ir sukasi

gem install rails -v=2.3.11

kaip gi be mysql supporto ? ;-)

gem install mysql

ech neturim gi passengerio !

find /opt/ruby/ -name passenger\* ... fail ?

diegiam...

gem install -v=2.2.15 passenger

other usefull tools

gem install rack -v=1.1.0
gem install -v=0.4.2 i18n
gem install -v=0.8.3 rake

darom apache2 moduli, aisku butinai reik turet apache2-devel paketa, headerius ir t.t ko reik pakompilint apache moduliam, leidziam:

/opt/ruby/bin/passenger-install-apache2-module

Jeigu viskas good tada belieka tik kur nors eiles tvarka po moduliu arba viduriuke apache httpd.conf'ige iterpt

LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /opt/ruby/bin/ruby


Cia kaip pavizdy dar virtual hosta aprodysiu nors po passenger apache modulio diegimo jis pats parodys ta pati

   <VirtualHost *:80>
     ServerName www.yourhost.com
     DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
     <Directory /somewhere/public>
        AllowOverride all              # <-- relax Apache security settings
        Options -MultiViews            # <-- MultiViews must be turned off
     </Directory>
  </VirtualHost>

Galima eit gert olous...