スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

rvm + ruby + Passengerのインストール

OSはFedora 14 x86_64。

rvmをインストール

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

~/.bashrcに↓を追加

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

ruby 1.9.2の最新をインストール

$ rvm install 1.9.2-head

rubyを今入れた1.9.2-headにする

$ rvm use 1.9.2-head

デフォルトのrubyを今入れた1.9.2-headにする

$ rvm use 1.9.2-head --default

こんな感じになる

$ ruby -v
ruby 1.9.2p160 (2011-01-16 revision 30579) [x86_64-linux]
$ which ruby
~/.rvm/rubies/ruby-1.9.2-head/bin/ruby

次にPassengerをインストールする。

Passengerで使うrubyを選択

$ rvm 1.9.2-head --passenger

Passengerで使うrubyに切り替え(デフォルトを1.9.2-headにしたから多分必要ないけど一応)

$ rvm 1.9.2-head

gemをインストール

$ gem install passenger

apache用モジュールをインストール

$ rvmsudo passenger-install-apache2-module
[sudo] password for hoge-user:
Welcome to the Phusion Passenger Apache 2 module installer, v3.0.2.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.


--------------------------------------------

Checking for required software...

* GNU C++ compiler... found at /usr/lib64/ccache/g++
* Curl development headers with SSL support... found
* OpenSSL development headers... found
* Zlib development headers... found
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
Unable to locate the RVM path. Your RVM installation is probably too old. Please update it with 'rvm update --head && rvm reload && rvm repair all'.

エラー…。とりあえず言うとおりに

$ rvm update --head
'rvm update --head' is deprecated, use 'rvm get head' instead

Original installed RVM version:

rvm 1.2.4 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]

remote: Counting objects: 86, done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 65 (delta 42), reused 4 (delta 1)
Unpacking objects: 100% (65/65), done.
From git://github.com/wayneeseguin/rvm
* branch master -> FETCH_HEAD
Updating cac5428..7e622b3
Fast-forward
LICENCE | 24 ++++++--------
README | 7 ++++
config/db | 3 +-
config/md5 | 1 +
contrib/bootstrap_rails_environment | 2 +-
contrib/install-system-wide | 9 ++++-
lib/VERSION.yml | 2 +-
pkg/gentoo/rvm-1.2.5.ebuild | 59 +++++++++++++++++++++++++++++++++++
scripts/cli | 4 +-
scripts/help | 3 +-
scripts/maglev | 22 ++++++-------
scripts/manage | 5 ++-
scripts/notes | 8 ++--
scripts/rubygems | 2 +-
scripts/utility | 2 +-
15 files changed, 111 insertions(+), 42 deletions(-)
create mode 100644 pkg/gentoo/rvm-1.2.5.ebuild

RVM: Shell scripts enabling management of multiple ruby environments.
RTFM: http://rvm.beginrescueend.com/
HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)

Upgrading the RVM installation in /home/hoge-user/.rvm/
Correct permissions for base binaries in /home/hoge-user/.rvm/bin...
Copying manpages into place.


Upgrade Notes

* rvm_trust_rvmrcs has been changed to rvm_trust_rvmrcs_flag for consistency

* Ruby package dependency list for your OS is given by:
rvm notes

* If you encounter any issues with a ruby 'X' your best bet is to:
rvm remove X ; rvm install X

* If you wish to have the 'pretty colors' again, set in ~/.rvmrc:
export rvm_pretty_print_flag=1

* If you see the following error message: Unknown alias name: 'default'
re-set your default ruby, this is due to a change in how default works.

Upgrade of RVM in /home/hoge-user/.rvm/ is complete.


hoge-user,

Thank you very much for using RVM! I sincerely hope that RVM helps to
make your work both easier and more enjoyable.

If you have any questions, issues and/or ideas for improvement please
join#rvm on irc.freenode.net and let me know, note you must register
(http://bit.ly/5mGjlm) and identify (/msg nickserv <nick> <pass>) to
talk, this prevents spambots from ruining our day.

My irc nickname is 'wayneeseguin' and I hang out in #rvm typically

~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT

If I do not respond right away, please hang around after asking your
question, I will respond as soon as I am back. It is best to talk in
#rvm itself as then other users can help out should I be offline.

Be sure to get head often as rvm development happens fast,
you can do this by running 'rvm get head' followed by 'rvm reload'
or opening a new shell

w???t

~ Wayne


Installed RVM HEAD version:

rvm 1.2.5 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]

$ rvm reload
$ rvm repair all
Repairing symlinks...
Symlinks repaired
Repairing archives...
Archives repaired
Regenerating environments...
Regenerating environment file for 'ruby-1.9.2-head'
Regenerating environment file for 'ruby-1.9.2-head@global'
Environments regenerated
Regenerating all wrappers...
Regenerating wrappers for ruby-1.9.2-head
Regenerating wrappers for ruby-1.9.2-head@global
Wrappers regenerated

で、再度apache用モジュールをインストール

$ rvmsudo passenger-install-apache2-module

同じエラーが出る。環境変数確認

$ rvmsudo bash -c export

ruby_pathが無い…。ということでこんな感じでインストール

$ rvmsudo 'rvm_path=/home/hoge-user/.rvm;passenger-install-apache2-module'
[sudo] password for hoge-user:
HOSTNAME=hoge-host-fedora
TERM=vt100
HISTSIZE=1000
QTDIR=/usr/lib64/qt-3.3
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
MAIL=/var/spool/mail/hoge-user
LANG=ja_JP.UTF-8
SHELL=/bin/bash
LOGNAME=root
USER=root
USERNAME=root
PATH=/home/hoge-user/.rvm/gems/ruby-1.9.2-head/bin:/home/hoge-user/.rvm/gems/ruby-1.9.2-head@global/bin:/home/hoge-user/.rvm/rubies/ruby-1.9.2-head/bin:/home/hoge-user/.rvm/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/hoge-user/bin
HOME=/root
SUDO_COMMAND=/usr/bin/env GEM_PATH=/home/hoge-user/.rvm/gems/ruby-1.9.2-head:/home/hoge-user/.rvm/gems/ruby-1.9.2-head@global GEM_HOME=/home/hoge-user/.rvm/gems/ruby-1.9.2-head PATH=/home/hoge-user/.rvm/gems/ruby-1.9.2-head/bin:/home/hoge-user/.rvm/gems/ruby-1.9.2-head@global/bin:/home/hoge-user/.rvm/rubies/ruby-1.9.2-head/bin:/home/hoge-user/.rvm/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/hoge-user/bin rvm_path=/home/hoge-user/.rvm
SUDO_USER=hoge-user
SUDO_UID=500
SUDO_GID=500
GEM_PATH=/home/hoge-user/.rvm/gems/ruby-1.9.2-head:/home/hoge-user/.rvm/gems/ruby-1.9.2-head@global
GEM_HOME=/home/hoge-user/.rvm/gems/ruby-1.9.2-head
rvm_path=/home/hoge-user/.rvm
Welcome to the Phusion Passenger Apache 2 module installer, v3.0.2.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.


--------------------------------------------

Checking for required software...

* GNU C++ compiler... found at /usr/lib64/ccache/g++
* Curl development headers with SSL support... found
* OpenSSL development headers... found
* Zlib development headers... found
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /home/hoge-user/.rvm/wrappers/ruby-1.9.2-head/rake
* rack... found
* Apache 2... found at /usr/sbin/httpd
* Apache 2 development headers... not found
* Apache Portable Runtime (APR) development headers... not found
* Apache Portable Runtime Utility (APU) development headers... not found

Some required software is not installed.
But don't worry, this installer will tell you how to install them.

Press Enter to continue, or Ctrl-C to abort.

--------------------------------------------

Installation instructions for required software

* To install Apache 2 development headers:
Please run yum install httpd-devel as root.

* To install Apache Portable Runtime (APR) development headers:
Please run yum install apr-devel as root.

* To install Apache Portable Runtime Utility (APU) development headers:
Please run yum install apr-util-devel as root.

If the aforementioned instructions didn't solve your problem, then please take
a look at the Users Guide:

/home/hoge-user/.rvm/gems/ruby-1.9.2-head/gems/passenger-3.0.2/doc/Users guide Apache.html

httpd-devel、apr-devel、apr-util-develが無いよとのこと。
httpd-develは入ってないけど、apr-develとapr-util-develは入ってるのだが…。

とりあえずhttpd-develをインストール

$ su-
# yum install httpd-devel

で、再々度apache用モジュールをインストール

# exit
$ rvmsudo 'rvm_path=/home/hoge-user/.rvm;passenger-install-apache2-module'

httpd-devel入れたらほかの2つもfoundになって無事インストール完了。

最後の方でapacheの設定に関する指示が出力される
--------------------------------------------
The Apache 2 module was successfully installed.

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

LoadModule passenger_module /home/hoge-user/.rvm/gems/ruby-1.9.2-head/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /home/hoge-user/.rvm/gems/ruby-1.9.2-head/gems/passenger-3.0.2
PassengerRuby /home/hoge-user/.rvm/wrappers/ruby-1.9.2-head/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.


--------------------------------------------
Deploying a Ruby on Rails application: an example

Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

<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>

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

/home/hoge-user/.rvm/gems/ruby-1.9.2-head/gems/passenger-3.0.2/doc/Users guide Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.

この記事のトラックバックURL

http://ysmt.blog21.fc2.com/tb.php/323-0c5fcf67

コメント

コメントする

管理者にだけ表示を許可する

Template Designed by DW99

上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。