Rubyのインストールとか
前にも書いた気がするけど、RubyをRVMでインストールしたりとか。あと今回はbundler使ってみたりとか。
環境:Ubuntu 11.04 32bit
いろいろインストール
$ sudo apt-get install -y libruby1.9.1 # 要らないかも $ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) $ cat <<'EOB' >> ~/.bashrc # rvm RVM=$HOME/.rvm/scripts/rvm if test -f "$RVM" then source "$RVM" fi EOB $ rvm package install iconv $ rvm package install openssl $ rvm package install readline $ rvm package install zlib $ rvm install 1.9.1 -C --with-iconv-dir=$HOME/.rvm/usr --with-openssl-dir=$HOME/.rvm/usr --with-readline-dir=$HOME/.rvm/usr --with-zlib-dir=$HOME/.rvm/usr $ rvm use 1.9.1 $ echo 'gem: --no-ri --no-rdoc' > ~/.gemrc $ gem install bundler
bundlerを使ってみる
$ mkdir project $ cd project $ cat <<'EOB' > Gemfile source "http://rubygems.org/" gem "padrino" EOB $ bundle install --path vendor/gems
で、実行すると
Error loading gem paths on load path in gem_prelude can't modify frozen string <internal:gem_prelude>:69:in `force_encoding' <internal:gem_prelude>:69:in `set_home' <internal:gem_prelude>:38:in `dir' <internal:gem_prelude>:76:in `set_paths' <internal:gem_prelude>:47:in `path' <internal:gem_prelude>:286:in `push_all_highest_version_gems_on_load_path' <internal:gem_prelude>:355:in `<compiled>' <internal:gem_prelude>:345:in `method_missing': undefined method `user_home' for Gem:Module (NoMethodError) from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems.rb:436:in `config_file' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:250:in `config_file_name' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:179:in `initialize' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems.rb:443:in `new' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems.rb:443:in `configuration' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:25:in `configuration' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:5:in `initialize' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:279:in `new' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:279:in `<module:Bundler>' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:1:in `<top (required)>' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/lib/bundler.rb:12:in `<top (required)>' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/sasaplus1/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/gems/bundler-1.0.13/bin/bundle:4:in `<top (required)>' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/bin/bundle:19:in `load' from /home/sasaplus1/.rvm/gems/ruby-1.9.1-p431/bin/bundle:19:in `<main>'
ちょっと何言ってるかわかんないです(>_<)
検索してみると1.9.2ではエラーが出ないらしいので1.9.2で試してみた。
Ruby1.9.2でインストール
$ rvm install 1.9.2 -C --with-iconv-dir=$HOME/.rvm/usr --with-openssl-dir=$HOME/.rvm/usr --with-readline-dir=$HOME/.rvm/usr --with-zlib-dir=$HOME/.rvm/usr $ rvm use 1.9.2 $ gem install bundler $ bundler install --path vendor/gems Fetching source index for http://rubygems.org/ Installing activesupport (3.0.7) Using bundler (1.0.13) Installing diff-lcs (1.1.2) Installing mime-types (1.16) Installing grit (2.4.1) Installing rack (1.2.2) Installing url_mount (0.2.1) Installing http_router (0.7.9) Installing i18n (0.6.0) Installing polyglot (0.3.1) Installing treetop (1.4.9) Installing mail (2.3.0) Installing tilt (1.3.1) Installing sinatra (1.2.6) Installing thor (0.14.6) Installing tzinfo (0.3.27) Installing padrino-core (0.9.28) Installing padrino-helpers (0.9.28) Installing padrino-admin (0.9.28) Installing padrino-cache (0.9.28) Installing padrino-gen (0.9.28) Installing padrino-mailer (0.9.28) Installing padrino (0.9.28) Your bundle is complete! It was installed into ./vendor/gems
え、なにそれ。回避方法が1.9.1を使わない、だなんて……
まあいい…かな?