, , . , .
, rvm. rails, . . , . . .
\curl -sSL https://get.rvm.io | bash
apt-get update
apt-get upgrade
apt-get install build-essential
rvm install ruby-2.0.0-p353
rvm ruby-2.0.0-p353@global
gem install passenger
passenger-install-apache2-module
- , , , .
passenger-install-apache2-module, - . , .
Installation instructions for required software
* To install Curl development headers with SSL support:
Please run apt-get install libcurl4-openssl-dev or libcurl4-gnutls-dev, whichever you prefer.
* To install Apache 2:
Please install it with apt-get install apache2-mpm-worker
* To install Apache 2 development headers:
Please install it with apt-get install apache2-threaded-dev
* To install Apache Portable Runtime (APR) development headers:
Please install it with apt-get install libapr1-dev
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with apt-get install libaprutil1-dev
, , apache. passenger-install-apache2-module.
, .
/etc/apache2/apache2.conf.
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p353@global/gems/passenger-4.0.29
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p353@global/ruby
, , , .
, , rails .
rvm use rvm ruby-2.0.0-p353@test
gem install rails
gem install bundler
rails new tester
cd tester
. .
root@rails-app:/etc/apache2/sites-enabled# cat /etc/apache2/sites-available/test.conf
<VirtualHost *:80>
ServerName www.something.com
DocumentRoot /home/rails/apps/tester/public
<Directory "/home/rails/apps/tester/public">
AllowOverride all
Options -MultiViews
Require all granted
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
,
sudo a2ensite test && sudo service apache2 restart
, Require all granted, , . , , Allow from all, . , Wiki Apache Org
[client 75.1.169.97:51729] AH01797: client denied by server configuration: /home/rails/apps/tester/public/
oh, , /var/log/apache2/
,
, , Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound).
, , .ruby-version .ruby-gemset .
rails@rails-app:~/apps/tester$ cat .ruby-version
ruby-2.0.0-p353
rails@rails-app:~/apps/tester$ cat .ruby-gemset
test
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
raise "RVM ruby lib is currently unavailable."
end
end
ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'
, , rvm gemset . , capistrano, rvm-capistrano. capistrano. Capistrano 3 rvm-capistrano.
, , . , .