ラベル rake の投稿を表示しています。 すべての投稿を表示
ラベル rake の投稿を表示しています。 すべての投稿を表示

2012年2月15日水曜日

CentOS6.2 Redmine1.3.1構築メモ(2)

CentOS6.2にRedmine1.3.1を構築する手順をまとめてみました。
 Step1. パッケージおよびインストーラの準備
 Step2. MySQLの準備
 Step3. Ruby Enterprise Edition インストール
 Step4. Redmine インストール
 Step5. ApacheにPassenger組込み

■構成情報
・OS:        CentOS6.2(64bit)
・MySQL:     5.1.52(OSバンドル)
・Ruby:      1.8.7(Ruby Enterprise Editionを利用)
 ・rack:    1.1.2
 ・rake:    0.9.2
 ・i18n:    0.4.2
・gem:       1.6.2
・Apache:    2.2.15(OSバンドル)
・Passenger: 3.0.11
・Redmine:   1.3.1


Step3. Ruby Enterprise Edition インストール
■OSバンドルのRuby有無確認
[root@redmine ~]# rpm -qa | grep ruby
[root@redmine ~]#
→既存Rubyは存在しないのでOK!


■プロキシ環境対応
[root@redmine ~]# export HTTP_PROXY=http://tanyao:xxxxxxx@proxy.kuitan.net:8080


■インストール
⇒インストール前確認
[root@redmine ~]# ll /usr/local/
合計 40
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 bin
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 etc
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 games
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 include
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 lib
drwxr-xr-x. 3 root root 4096  2月  7 02:22 2012 lib64
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 libexec
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 sbin
drwxr-xr-x. 6 root root 4096  2月  7 02:22 2012 share
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 src
[root@redmine ~]#

⇒解凍&インストール
[root@redmine src]# tar -zxf ruby-enterprise-1.8.7-2012.01.tar.gz
[root@redmine src]# cd ruby-enterprise-1.8.7-2012.01
[root@redmine ruby-enterprise-1.8.7-2012.01]# ./installer --dont-install-useful-gems --no-dev-docs
Welcome to the Ruby Enterprise Edition installer
This installer will help you install Ruby Enterprise Edition 1.8.7-2012.01.
Don't worry, none of your system files will be touched if you don't want them
to, so there is no risk that things will screw up.

You can expect this from the installation process:

  1. Ruby Enterprise Edition will be compiled and optimized for speed for this
     system.
  2. Ruby on Rails will be installed for Ruby Enterprise Edition.
  3. You will learn how to tell Phusion Passenger to use Ruby Enterprise
     Edition instead of regular Ruby.

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

Checking for required software...

 * Non-broken C compiler... found at /usr/bin/gcc
 * Non-broken C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * The 'patch' tool... found at /usr/bin/patch
 * Zlib development headers... found
 * OpenSSL development headers... found
 * GNU Readline development headers... found
--------------------------------------------
Target directory

Where would you like to install Ruby Enterprise Edition to?
(All Ruby Enterprise Edition files will be put inside that directory.)

[/opt/ruby-enterprise-1.8.7-2012.01] : /usr/local
--------------------------------------------
Compiling and optimizing the memory allocator for Ruby Enterprise Edition
In the mean time, feel free to grab a cup of coffee.
(中略 約2分)

Ruby Enterprise Edition is successfully installed!
If want to use Phusion Passenger (http://www.modrails.com) in combination
with Ruby Enterprise Edition, then you must reinstall Phusion Passenger against
Ruby Enterprise Edition, as follows:

  /usr/local/bin/passenger-install-apache2-module

Make sure you don't forget to paste the Apache configuration directives that
the installer gives you.


If you ever want to uninstall Ruby Enterprise Edition, simply remove this
directory:

  /usr/local

If you have any questions, feel free to visit our website:

  http://www.rubyenterpriseedition.com

Enjoy Ruby Enterprise Edition, a product of Phusion (www.phusion.nl) :-)
[root@redmine ruby-enterprise-1.8.7-2012.01]#

⇒インストール後
[root@redmine ~]# ll /usr/local/
合計 40
drwxr-xr-x. 2 root root 4096  2月  8 11:38 2012 bin
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 etc
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 games
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 include
drwxr-xr-x. 3 root root 4096  2月  8 11:38 2012 lib
drwxr-xr-x. 3 root root 4096  2月  7 02:22 2012 lib64
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 libexec
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 sbin
drwxr-xr-x. 6 root root 4096  2月  7 02:22 2012 share
drwxr-xr-x. 2 root root 4096  9月 23 20:50 2011 src
[root@redmine ~]#

⇒バージョン確認
[root@redmine ~]# ruby -v
ruby 1.8.7 (2011-12-28 MBARI 8/0x6770 on patchlevel 357) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.01


■gemパッケージのインストール
⇒Rack 1.1.2のインストール
[root@redmine ~]# gem install rack -v=1.1.2 --no-rdoc --no-ri
Fetching: rack-1.1.2.gem (100%)
Successfully installed rack-1.1.2
1 gem installed

⇒rake 0.9.2のインストール
[root@redmine ~]# gem install rake -v=0.9.2 --no-rdoc --no-ri
Fetching: rake-0.9.2.gem (100%)
Successfully installed rake-0.9.2
1 gem installed

⇒i18n 0.4.2のインストール
[root@redmine ~]# gem install i18n -v=0.4.2 --no-rdoc --no-ri
Fetching: i18n-0.4.2.gem (100%)
Successfully installed i18n-0.4.2
1 gem installed

⇒RMagickのインストール
[root@redmine ~]# gem install rmagick --no-rdoc --no-ri
Fetching: rmagick-2.13.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed

⇒RDocのインストール
[root@redmine ~]# gem install rdoc --no-ri --no-rdoc
Fetching: json-1.6.5.gem (100%)
Building native extensions.  This could take a while...
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed json-1.6.5
Successfully installed rdoc-3.12
2 gems installed

⇒Ruby用MySQLドライバのインストール
[root@redmine ~]# gem install mysql --no-rdoc --no-ri
Fetching: mysql-2.8.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

⇒確認
[root@redmine ~]# gem list

*** LOCAL GEMS ***

i18n (0.4.2)
json (1.6.5)
mysql (2.8.1)
rack (1.1.2)
rake (0.9.2)
rdoc (3.12)
rmagick (2.13.1)
[root@redmine ~]#


Step4. Redmine インストール
■インストール(解凍するだけ)
⇒/optに解凍
[root@redmine src]# tar -zxf redmine-1.3.1.tar.gz -C /opt/


■Redmine関連ファイル設定
⇒database.yml作成
[root@redmine src]# cd /opt/redmine-1.3.1/
[root@redmine redmine-1.3.1]# vi config/database.yml
[root@redmine redmine-1.3.1]# cat config/database.yml
production:
  adapter: mysql
  database: db_redmine
  host: localhost
  username: user_redmine
  password: ienaiyo
  encoding: utf8
[root@redmine redmine-1.3.1]#

⇒configuration.ymlの設定
[root@redmine redmine-1.3.1]# cp config/configuration.yml.example config/configuration.yml
[root@redmine redmine-1.3.1]# vi config/configuration.yml
[root@redmine redmine-1.3.1]# tail -11 config/configuration.yml
production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "localhost"
      port: 25
      domain: 'kuitan.net'

# specific configuration options for development environment
# that overrides the default ones
development:
[root@redmine redmine-1.3.1]#

⇒Redmineの初期設定とデータベースのテーブル作成
[root@redmine redmine-1.3.1]# rake generate_session_store
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /opt/redmine-1.3.1/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /opt/redmine-1.3.1/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
(中略)
[root@redmine redmine-1.3.1]#

[root@redmine redmine-1.3.1]# rake db:migrate RAILS_ENV=production
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /opt/redmine-1.3.1/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /opt/redmine-1.3.1/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
(中略)
Missing these required gems:
  rubytree  >= 0

You're running:
  ruby 1.8.7.357 at /usr/local/bin/ruby
  rubygems 1.8.15 at /usr/local/lib/ruby/gems/1.8, /root/.gem/ruby/1.8

Run `rake gems:install` to install the missing gems.
[root@redmine redmine-1.3.1]#

[root@redmine redmine-1.3.1]# gem -v
1.8.15
→gemのバージョンが高すぎることが問題のようだ。

⇒gemのバージョンを1.7.1にダウングレード
[root@redmine ~]# gem update --system 1.7.1
Updating rubygems-update
Fetching: rubygems-update-1.7.1.gem (100%)
Successfully installed rubygems-update-1.7.1
Installing RubyGems 1.7.1
RubyGems 1.7.1 installed

=== 1.7.1 / 2011-03-32

* 1 bug fix:
  * Fixed missing file in Manifest.txt.  (Also a bug in hoe was fixed where
    `rake check_manifest` showing a diff would not exit with an error.)


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

RubyGems installed the following executables:
        /usr/local/bin/gem

RubyGems system software updated
[root@redmine ~]# gem -v
1.7.1
[root@redmine ~]#

[root@redmine redmine-1.3.1]# rake generate_session_store
NOTE: SourceIndex.new(hash) is deprecated; From /opt/redmine-1.3.1/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
[root@redmine redmine-1.3.1]#
1.7.1でも無理(T-T) 残念…。

⇒1.6.2で再々チャレンジ。
[root@redmine ~]# gem update --system 1.6.2
Updating rubygems-update
Fetching: rubygems-update-1.6.2.gem (100%)
Successfully installed rubygems-update-1.6.2
Installing RubyGems 1.6.2
RubyGems 1.6.2 installed

=== 1.6.2 / 2011-03-08

Bug Fixes:

* require of an activated gem could cause activation conflicts.  Fixes
  Bug #29056 by Dave Verwer.
* `gem outdated` now works with up-to-date prerelease gems.


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

RubyGems installed the following executables:
        /usr/local/bin/gem

RubyGems system software updated
[root@redmine ~]# gem -v
1.6.2
[root@redmine ~]#

[root@redmine ~]# rake generate_session_store
[root@redmine ~]#
→成功したっ!!

[root@redmine redmine-1.3.1]# rake db:migrate RAILS_ENV=production
==  Setup: migrating =====================================================
-- create_table("attachments", {:force=>true})
   -> 0.0841s
-- create_table("auth_sources", {:force=>true})
(中略)

-- add_index(:changeset_parents, [:parent_id], {:name=>:changeset_parents_parent_ids, :unique=>false})
   -> 0.1499s
==  CreateChangesetParents: migrated (0.3711s) ===========================

[root@redmine redmine-1.3.1]#
→スキーマ作成完了。

2011年9月19日月曜日

CentOS5.7にRuby1.9.2インストール

■OSバンドルのRuby有無確認
[root@rails01 ~]# rpm -qa | grep ruby
[root@rails01 ~]#
⇒既存Rubyは存在しないのでOK!


■インストーラダウンロード
ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
smb経由でサーバのsrcディレクトリにアップロード。


■インストール
[root@rails01 ~]# cd /home/public/src/
[root@rails01 src]# tar -zxf ruby-1.9.2-p290.tar.gz
[root@rails01 src]# cd ruby-1.9.2-p290
[root@rails01 ruby-1.9.2-p290]# ./configure --prefix=/usr/local
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
(中略)
ruby library version = 1.9.1
configure: creating ./config.status
config.status: creating Makefile

[root@rails01 ruby-1.9.2-p290]# make
gcc -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initiali                                    zers -Wno-long-long -I. -I.ext/include/x86_64-linux -I./include -I. -DRUBY_EXPORT   -o main.o -c main.c
gcc -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initiali                                    zers -Wno-long-long -I. -I.ext/include/x86_64-linux -I./include -I. -DRUBY_EXPORT   -o dln.o -c dln.c
(中略:10分くらい)
Generating file member index...
Generating page index...
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  -e 'File.open("doc/capi/.timestamp", "w"){|f| f.puts(Time.now)}'

[root@rails01 ruby-1.9.2-p290]# make install
(中略)
installing manpages:          /usr/local/ruby/share/man/man1
installing default gems:      /usr/local/ruby/lib/ruby/gems/1.9.1 (cache, doc, gems, specifications)
                              rake 0.8.7
                              rdoc 2.5.8
                              minitest 1.6.0
⇒バージョン確認
[root@rails01 ~]# ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
[root@rails01 ~]# gem -v
1.3.7


■Railsインストール
[root@rails01 ~]# gem install rails
Building native extensions.  This could take a while...
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed multi_json-1.0.3
Successfully installed activesupport-3.1.0
Successfully installed builder-3.0.0
Successfully installed i18n-0.6.0
Successfully installed bcrypt-ruby-3.0.1
Successfully installed activemodel-3.1.0
Successfully installed rack-1.3.3
Successfully installed rack-cache-1.0.3
Successfully installed rack-test-0.6.1
Successfully installed rack-mount-0.8.3
Successfully installed hike-1.2.1
Successfully installed tilt-1.3.3
Successfully installed sprockets-2.0.0
Successfully installed erubis-2.7.0
Successfully installed actionpack-3.1.0
Successfully installed arel-2.2.1
Successfully installed tzinfo-0.3.29
Successfully installed activerecord-3.1.0
Successfully installed activeresource-3.1.0
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.2
Successfully installed treetop-1.4.10
Successfully installed mail-2.3.0
Successfully installed actionmailer-3.1.0
Successfully installed thor-0.14.6
Successfully installed rack-ssl-1.3.2
Successfully installed rdoc-3.9.4
Successfully installed railties-3.1.0
Successfully installed bundler-1.0.18
Successfully installed rails-3.1.0
30 gems installed
Installing ri documentation for multi_json-1.0.3...
Installing ri documentation for activesupport-3.1.0...
Installing ri documentation for builder-3.0.0...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping
Installing ri documentation for i18n-0.6.0...
Installing ri documentation for bcrypt-ruby-3.0.1...
Installing ri documentation for activemodel-3.1.0...
Installing ri documentation for rack-1.3.3...
Installing ri documentation for rack-cache-1.0.3...
Installing ri documentation for rack-test-0.6.1...
Installing ri documentation for rack-mount-0.8.3...
Installing ri documentation for hike-1.2.1...
Installing ri documentation for tilt-1.3.3...
Installing ri documentation for sprockets-2.0.0...
Installing ri documentation for erubis-2.7.0...
Installing ri documentation for actionpack-3.1.0...
Installing ri documentation for arel-2.2.1...
Installing ri documentation for tzinfo-0.3.29...
Installing ri documentation for activerecord-3.1.0...
Installing ri documentation for activeresource-3.1.0...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.2...
Installing ri documentation for treetop-1.4.10...
Installing ri documentation for mail-2.3.0...
Installing ri documentation for actionmailer-3.1.0...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for rack-ssl-1.3.2...
Installing ri documentation for rdoc-3.9.4...
Installing ri documentation for railties-3.1.0...
Installing ri documentation for bundler-1.0.18...
Installing ri documentation for rails-3.1.0...
file 'lib' not found
Installing RDoc documentation for multi_json-1.0.3...
Installing RDoc documentation for activesupport-3.1.0...
Installing RDoc documentation for builder-3.0.0...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping
Installing RDoc documentation for i18n-0.6.0...
Installing RDoc documentation for bcrypt-ruby-3.0.1...
Installing RDoc documentation for activemodel-3.1.0...
Installing RDoc documentation for rack-1.3.3...
Installing RDoc documentation for rack-cache-1.0.3...
Installing RDoc documentation for rack-test-0.6.1...
Installing RDoc documentation for rack-mount-0.8.3...
Installing RDoc documentation for hike-1.2.1...
Installing RDoc documentation for tilt-1.3.3...
Installing RDoc documentation for sprockets-2.0.0...
Installing RDoc documentation for erubis-2.7.0...
Installing RDoc documentation for actionpack-3.1.0...
Installing RDoc documentation for arel-2.2.1...
Installing RDoc documentation for tzinfo-0.3.29...
Installing RDoc documentation for activerecord-3.1.0...
Installing RDoc documentation for activeresource-3.1.0...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.2...
Installing RDoc documentation for treetop-1.4.10...
Installing RDoc documentation for mail-2.3.0...
Installing RDoc documentation for actionmailer-3.1.0...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for rack-ssl-1.3.2...
Installing RDoc documentation for rdoc-3.9.4...
Installing RDoc documentation for railties-3.1.0...
Installing RDoc documentation for bundler-1.0.18...
Installing RDoc documentation for rails-3.1.0...
file 'lib' not found

⇒バージョン確認
[root@rails01 ~]# rails --version
Rails 3.1.0


■サンプルプロジェクト作成
[root@rails01 ~]# mkdir rails_projects
[root@rails01 ~]# cd rails_projects/
[root@rails01 rails_projects]# rails new sample -d mysql
      create
      create  README
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching source index for http://rubygems.org/
Installing rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.3)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.0)
Using actionpack (3.1.0)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0)
Using arel (2.2.1)
Using tzinfo (0.3.29)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Installing ansi (1.3.0)
Using bundler (1.0.18)
Installing coffee-script-source (1.1.2)
Installing execjs (1.2.6)
Installing coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.1.0)
Installing coffee-rails (3.1.1)
Installing jquery-rails (1.0.14)
Installing mysql2 (0.3.7) with native extensions
Using rails (3.1.0)
Installing sass (3.1.7)
Installing sass-rails (3.1.2)
Installing turn (0.8.2)
Installing uglifier (1.0.3)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[root@rails01 rails_projects]#


■データベース準備
[root@rails01 ~]# /etc/init.d/mysqld start
MySQL を起動中:                                            [  OK  ]

⇒プロジェクトディレクトリに移動してデータベース作成
[root@rails01 ~]# cd /root/rails_projects/sample/
[root@rails01 sample]# rake db:create
(in /root/rails_projects/sample)
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.6/lib/execjs/runtimes.rb:46:in `autodetect'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.6/lib/execjs.rb:5:in `'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.2.6/lib/execjs.rb:4:in `'
(中略)
/usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/bin/rake:31:in `
' ⇒上記エラー対応のためGemfile修正 [root@rails01 sample]# vi Gemfile [root@rails01 sample]# head Gemfile source 'http://rubygems.org' gem 'rails', '3.1.0' # add 20110919 gem 'therubyracer' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' [root@rails01 sample]# bundle update Fetching source index for http://rubygems.org/ (中略) Installing therubyracer (0.9.4) with native extensions Using turn (0.8.2) Using uglifier (1.0.3) Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed. ⇒再びデータベース作成 [root@rails01 sample]# rake db:create (in /root/rails_projects/sample) rake aborted! uninitialized constant Rake::DSL /usr/local/lib/ruby/1.9.1/rake.rb:2482:in `const_missing' (後略) ⇒上記エラー対応のためGemfile修正 [root@rails01 sample]# vi Gemfile [root@rails01 sample]# head Gemfile source 'http://rubygems.org' gem 'rails', '3.1.0' # add 20110919 gem 'therubyracer' gem 'rake', '0.8.7' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' [root@rails01 sample]# bundle update Fetching source index for http://rubygems.org/ Using rake (0.8.7) Using multi_json (1.0.3) (後略) ⇒再びデータベース作成 [root@rails01 sample]# rake db:create (in /root/rails_projects/sample) [root@rails01 sample]# mysqlshow +--------------------+ | Databases | +--------------------+ | information_schema | | mysql | | sample_development | | sample_test | | test | +--------------------+ データベースが作成された!! ■Webサーバ起動 [root@rails01 sample]# rails s => Booting WEBrick => Rails 3.1.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2011-09-19 22:43:01] INFO WEBrick 1.3.1 [2011-09-19 22:43:01] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] [2011-09-19 22:43:01] INFO WEBrick::HTTPServer#start: pid=12327 port=3000 または、 [root@rails01 sample]# rails s > log/WEBrick.log & [1] 25595 ■ブラウザで確認 http://192.168.1.14:3000/