2011年04月25日 [長年日記]
■ MacOSX 10.6.7 で RVM を利用してRuby1.9.x をインストールするとエラーになる
会社のマシンにインストールしようとしたらエラーが出た。
最近自宅のMacでもちょいハマりしたのでメモっておく。
makeのログを見ると
Error running 'make ', please check /Users/user/.rvm/log/ruby-1.9.2-head/make*.log
とあったので、
readline をインストール
$ rvm package install readline
次に
$ rvm install 1.9.2-head --with-readline-dir=$HOME/.rvm/usr
$ rvm list rvm rubies ruby-1.8.7-p174 [ x86_64 ] ruby-1.8.7-p249 [ x86_64 ] ruby-1.9.2-head [ x86_64 ] ruby-1.9.2-preview3 [ x86_64 ]
でインストールできました。
■ MacOSX 10.6.7 で RVM を利用してRuby1.9.x と rails3.0.x の環境を作る
- ruby のバージョン
$ ruby -v ruby 1.9.2p188 (2011-03-28 revision 31204) [x86_64-darwin10.7.0]
- rails3用のgemset作成
$ rvm gemset create rails3dev info: Gemset 'rails3dev' created.
$ rvm gemset use rails3dev info: Now using gemset 'rails3dev'
- rails3 インストール
$ gem install rails --version=3.0.7 /Users/user/.rvm/rubies/ruby-1.9.2-head/bin/gem:4: warning: Insecure world writable dir /usr/local/bin/clang in PATH, mode 040777 Fetching: activesupport-3.0.7.gem (100%) Fetching: builder-2.1.2.gem (100%) WARNING: builder-2.1.2 has an invalid nil value for @cert_chain Fetching: i18n-0.5.0.gem (100%) Fetching: activemodel-3.0.7.gem (100%) Fetching: rack-1.2.2.gem (100%) Fetching: rack-test-0.5.7.gem (100%) Fetching: rack-mount-0.6.14.gem (100%) Fetching: tzinfo-0.3.26.gem (100%) Fetching: abstract-1.0.0.gem (100%) WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain Fetching: erubis-2.6.6.gem (100%) Fetching: actionpack-3.0.7.gem (100%) Fetching: arel-2.0.9.gem (100%) Fetching: activerecord-3.0.7.gem (100%) Fetching: activeresource-3.0.7.gem (100%) Fetching: mime-types-1.16.gem (100%) Fetching: polyglot-0.3.1.gem (100%) Fetching: treetop-1.4.9.gem (100%) Fetching: mail-2.2.17.gem (100%) Fetching: actionmailer-3.0.7.gem (100%) Fetching: thor-0.14.6.gem (100%) Fetching: railties-3.0.7.gem (100%) Fetching: bundler-1.0.12.gem (100%) Fetching: rails-3.0.7.gem (100%) Successfully installed activesupport-3.0.7 Successfully installed builder-2.1.2 Successfully installed i18n-0.5.0 Successfully installed activemodel-3.0.7 Successfully installed rack-1.2.2 Successfully installed rack-test-0.5.7 Successfully installed rack-mount-0.6.14 Successfully installed tzinfo-0.3.26 Successfully installed abstract-1.0.0 Successfully installed erubis-2.6.6 Successfully installed actionpack-3.0.7 Successfully installed arel-2.0.9 Successfully installed activerecord-3.0.7 Successfully installed activeresource-3.0.7 Successfully installed mime-types-1.16 Successfully installed polyglot-0.3.1 Successfully installed treetop-1.4.9 Successfully installed mail-2.2.17 Successfully installed actionmailer-3.0.7 Successfully installed thor-0.14.6 Successfully installed railties-3.0.7 Successfully installed bundler-1.0.12 Successfully installed rails-3.0.7 23 gems installed
だけどrdoc関連でエラーが発生。各gemはインストールされているようなのでここでは気にしないことにする
/Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /Users/user/.rvm/gems/ruby-1.9.2-head@global/gems/rdoc-3.5.3/lib/rdoc/ruby_lex.rb:831: invalid multibyte escape: /[\w\x80-\xFF]/ (SyntaxError) from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/user/.rvm/gems/ruby-1.9.2-head@global/gems/rdoc-3.5.3/lib/rdoc/parser/ruby.rb:11:in `<top (required)>' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/user/.rvm/gems/ruby-1.9.2-head@global/gems/rdoc-3.5.3/lib/rdoc/rdoc.rb:8:in `<top (required)>' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/doc_manager.rb:42:in `load_rdoc' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/doc_manager.rb:214:in `setup_rdoc' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/doc_manager.rb:115:in `generate_ri' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:147:in `block in execute' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:146:in `each' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:146:in `execute' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in `invoke' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:133:in `process_args' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:103:in `run' from /Users/user/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:64:in `run' from /Users/user/.rvm/rubies/ruby-1.9.2-head/bin/gem:26:in `<main>'
- gem の確認
$ gem list /Users/user/.rvm/rubies/ruby-1.9.2-head/bin/gem:4: warning: Insecure world writable dir /usr/local/bin/clang in PATH, mode 040777
*** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.7) actionpack (3.0.7) activemodel (3.0.7) activerecord (3.0.7) activeresource (3.0.7) activesupport (3.0.7) arel (2.0.9) builder (2.1.2) bundler (1.0.12) erubis (2.6.6) i18n (0.5.0) mail (2.2.17) mime-types (1.16) polyglot (0.3.1) rack (1.2.2) rack-mount (0.6.14) rack-test (0.5.7) rails (3.0.7) railties (3.0.7) rake (0.8.7) rdoc (3.5.3) rubygems-update (1.7.2) thor (0.14.6) treetop (1.4.9) tzinfo (0.3.26)