helen's blog



$ rails -v
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.

2.1.0以上にアップグレードして"gem pristine --all"したほうが効率良くなるよ

gem pristineとは
$ gem pristine -h
    Restores installed gems to pristine condition from files located in the gem cache

    The pristine command compares an installed gem with the contents of its cached .gem file 
    and restores any files that don't match the cached .gem's copy.

    If you have made modifications to an installed gem, the pristine command
    will revert them.  All extensions are rebuilt and all bin stubs for the gem
    are regenerated after checking for modifications.

    If the cached gem cannot be found it will be downloaded.

    If --no-extensions is provided pristine will not attempt to restore a gem
    with an extension.


  • pristineをすると、インストールされたgemとgemのキャッシュを比較し、もし一致しなければキャッシュされたものを復元する
  • インストールしたgemに変更を加えていた場合、pristineコマンドは戻してしまう
  • すべての再構築と変更を確認した後のgemの再構築する
  • キャッシュされたgemが見つからなかった場合はダウンロードされる
  • --no-extensionsをつけるとgemの拡張を復元しない


つまりgem pristineで


$ gem update -h
        --system [VERSION]           Update the RubyGems system software

# --system "バージョン番号" で指定したバージョンにあげられる

$ gem update --system 2.1.0
Updating rubygems-update
Fetching: rubygems-update-2.1.0.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

# sudo した
$ sudo gem update --system 2.1.0                                                      
Updating rubygems-update
Fetching: rubygems-update-2.1.0.gem (100%) # これ
Successfully installed rubygems-update-2.1.0
Parsing documentation for rubygems-update-2.1.0
Installing ri documentation for rubygems-update-2.1.0
Installing darkfish documentation for rubygems-update-2.1.0
Done installing documentation for rubygems-update after 2 seconds
Installing RubyGems 2.1.0
RubyGems 2.1.0 installed
Parsing documentation for rubygems-2.1.0
Installing ri documentation for rubygems-2.1.0


RubyGems installed the following executables:

Ruby Interactive (ri) documentation was installed. ri is kind of like man # ri?
pages for ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated


Ruby Interactive (ri) documentation


--no-document flagをつけるか.gemrcに設定すればいいらしい


$ sudo gem pristine --all 
Restoring gems to pristine condition...
Restored CFPropertyList-2.2.8
Restored actionmailer-
Restored actionpack-
Restored actionview-
Restored activejob-
Restored activemodel-
Restored activerecord-
Restored activesupport-
Restored arel-6.0.3
Skipped bigdecimal-1.2.0, it is a default gem
Building native extensions.  This could take a while...
Restored binding_of_caller-0.7.2
Restored builder-3.2.2
Restored bundler-1.11.2
Restored bundler-1.8.4
Building native extensions.  This could take a while...
Restored byebug-8.2.4
Restored coffee-rails-4.1.1
Restored coffee-script-2.4.1
Restored coffee-script-source-1.10.0
Restored concurrent-ruby-1.0.1
Restored concurrent-ruby-1.0.0
Building native extensions.  This could take a while...
Restored debug_inspector-0.0.2
Restored erubis-2.7.0
Restored execjs-2.6.0
Restored globalid-0.3.6
Restored i18n-0.7.0
Skipped io-console-0.4.2, it is a default gem
Restored jbuilder-2.4.1
Restored jquery-rails-4.1.1
Building native extensions.  This could take a while...
Restored json-1.8.3
Skipped json-1.7.7, it is a default gem
Building native extensions with: '--ignore-dependencies --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/usr/include/libxml2 --with-xml2-lib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/usr/lib --with-xslt-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/usr/include --with-xslt-lib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/usr/lib'
This could take a while...
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory - /Library/Ruby/Gems/2.0.0/gems/libxml-ruby-2.6.0/ext/libxml/gem_make.out



Libxml-ruby's primary advantage over REXML is performance - if speed is your need, these are good libraries to consider, as demonstrated by the informal benchmark below.
libxml-ruby | RubyGems.org | your community gem host



とりあえずrails sはできるようになったのでここはあとでなおす