AmazonのAMIを使いRails 2.3を入れてみようとしていろいろステップが必要だったので共有します。
Railsライブラリは入りますが最後、Railsを起動で成功していません。
今回は、Fedora 8の"Ruby on Rails Web Starter (AMI Id: ami-22b0534b)"を使いました。
パッケージ管理で最新のFedora 8のパッケージに入っているRailsに更新します。
# yum install rubygem-rails
yum listで見てもRailsは2.2のままです。gemでチェックしてみます。
# gem list
actionmailer (2.2.2, 2.1.1)
actionpack (2.2.2, 2.1.1)
activerecord (2.2.2, 2.1.1)
activeresource (2.2.2, 2.1.1)
activesupport (2.2.2, 2.1.1)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
mongrel (1.1.5)
open4 (0.9.6)
rails (2.2.2, 2.1.1)
rake (0.8.3)
まずはgemsを更新してみます。
# gem update
Updating installed gems
Updating actionmailer
ERROR: While executing gem ... (Gem::InstallError)
actionpack requires rack (~> 1.0.0, runtime)
Rack 1.0.0が求められるようなのでバージョンを指定して先にインストールします。
# gem install rack -v 1.0.0
Successfully installed rack-1.0.0
1 gem installed
Installing ri documentation for rack-1.0.0...
Installing RDoc documentation for rack-1.0.0...
再度更新してみます。
# gem upgrade
Updating installed gems
Updating actionmailer
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Updating activeresource
Successfully installed activeresource-2.3.5
Updating fastthread
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.7
Updating open4
Successfully installed open4-1.0.1
Updating rails
Successfully installed rails-2.3.5
Updating rake
Successfully installed rake-0.8.7
Gems updated: actionpack, actionmailer, activeresource, fastthread, open4, rails, rake
無事Railsの最新状態になりました。Railsアプリケーションを作ります。
# rails app
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem test-spec (>= 0) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:134:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
必要だといわれるパッケージtest-specをインストールします。
# gem install test-spec
# rails app
再度エラーが出てしまいます。
# rails app
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem camping (>= 0) (Gem::LoadError)
必要なパッケージを入れます。
# gem install camping
# gem install fcgi
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install fcgi
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-fcgi-dir
--without-fcgi-dir
--with-fcgi-include
--without-fcgi-include=${fcgi-dir}/include
--with-fcgi-lib
--without-fcgi-lib=${fcgi-dir}/lib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/ext/fcgi/gem_make.out
fcgiを先にgemsではなくyumでインストールしました。
# yum install fcgi fcgi-devel
# gem install fcgi
fcgiの問題が解決したあとも、色々なパッケージのインストールを求められましたので状況を省略して必要なコマンドを列挙します。
gem install memcache-client ruby-openid
gem install ruby-openid --version='~>2.0.0'
yum install gcc-c++
gem install thin
gem install shotgun
gem rack-test
途中ruby-openidの問題は原因が分からず、以下のサイトが参考になりました。
http://www.v-sands.com/~jgb/tecmemo/?Sinatra+%BD%E0%C8%F7
これでようやくrailsコマンドが動くようになりました。
# rails app
# cd app/
database.ymlをMySQLに修正し、サーバを起動してみます。
# script/server
Rails requires RubyGems >= 1.3.2 (you have 1.2.0). Please `gem update --system` and try again.
なんと起動時にgemsのバージョンが古いことを怒られます。
# gem install rubygems-update
# update_rubygems
# gem install session
# gem install hoe-seattlerb
# gem install rubyforge
# update_rubygems
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem gemcutter (>= 0.2.1) (Gem::LoadError)
gemcutterを必要とされますが、
# gem install gemcutter
ERROR: Error installing gemcutter:
gemcutter requires RubyGems version >= 1.3.5
と表示され、gemcutterとrubygemsがお互いに必要とする三すくみ状態で表題の通り詰まってしまいました。
Railsライブラリは入りますが最後、Railsを起動で成功していません。
今回は、Fedora 8の"Ruby on Rails Web Starter (AMI Id: ami-22b0534b)"を使いました。
パッケージ管理で最新のFedora 8のパッケージに入っているRailsに更新します。
# yum install rubygem-rails
yum listで見てもRailsは2.2のままです。gemでチェックしてみます。
# gem list
actionmailer (2.2.2, 2.1.1)
actionpack (2.2.2, 2.1.1)
activerecord (2.2.2, 2.1.1)
activeresource (2.2.2, 2.1.1)
activesupport (2.2.2, 2.1.1)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
mongrel (1.1.5)
open4 (0.9.6)
rails (2.2.2, 2.1.1)
rake (0.8.3)
まずはgemsを更新してみます。
# gem update
Updating installed gems
Updating actionmailer
ERROR: While executing gem ... (Gem::InstallError)
actionpack requires rack (~> 1.0.0, runtime)
Rack 1.0.0が求められるようなのでバージョンを指定して先にインストールします。
# gem install rack -v 1.0.0
Successfully installed rack-1.0.0
1 gem installed
Installing ri documentation for rack-1.0.0...
Installing RDoc documentation for rack-1.0.0...
再度更新してみます。
# gem upgrade
Updating installed gems
Updating actionmailer
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Updating activeresource
Successfully installed activeresource-2.3.5
Updating fastthread
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.7
Updating open4
Successfully installed open4-1.0.1
Updating rails
Successfully installed rails-2.3.5
Updating rake
Successfully installed rake-0.8.7
Gems updated: actionpack, actionmailer, activeresource, fastthread, open4, rails, rake
無事Railsの最新状態になりました。Railsアプリケーションを作ります。
# rails app
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem test-spec (>= 0) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:134:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:158:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:157:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
必要だといわれるパッケージtest-specをインストールします。
# gem install test-spec
# rails app
再度エラーが出てしまいます。
# rails app
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem camping (>= 0) (Gem::LoadError)
必要なパッケージを入れます。
# gem install camping
# gem install fcgi
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install fcgi
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-fcgi-dir
--without-fcgi-dir
--with-fcgi-include
--without-fcgi-include=${fcgi-dir}/include
--with-fcgi-lib
--without-fcgi-lib=${fcgi-dir}/lib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/ext/fcgi/gem_make.out
fcgiを先にgemsではなくyumでインストールしました。
# yum install fcgi fcgi-devel
# gem install fcgi
fcgiの問題が解決したあとも、色々なパッケージのインストールを求められましたので状況を省略して必要なコマンドを列挙します。
gem install memcache-client ruby-openid
gem install ruby-openid --version='~>2.0.0'
yum install gcc-c++
gem install thin
gem install shotgun
gem rack-test
途中ruby-openidの問題は原因が分からず、以下のサイトが参考になりました。
http://www.v-sands.com/~jgb/tecmemo/?Sinatra+%BD%E0%C8%F7
これでようやくrailsコマンドが動くようになりました。
# rails app
# cd app/
database.ymlをMySQLに修正し、サーバを起動してみます。
# script/server
Rails requires RubyGems >= 1.3.2 (you have 1.2.0). Please `gem update --system` and try again.
なんと起動時にgemsのバージョンが古いことを怒られます。
# gem install rubygems-update
# update_rubygems
# gem install session
# gem install hoe-seattlerb
# gem install rubyforge
# update_rubygems
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem gemcutter (>= 0.2.1) (Gem::LoadError)
gemcutterを必要とされますが、
# gem install gemcutter
ERROR: Error installing gemcutter:
gemcutter requires RubyGems version >= 1.3.5
と表示され、gemcutterとrubygemsがお互いに必要とする三すくみ状態で表題の通り詰まってしまいました。
コメント