RMagick

brewのMavericksでのupdate

pathを調整している間に動いた.でも,たぶんserverが落ちていたのでは...

$ xcode-select --install
$ sudo xcodebuild -license

imagemagickをbrewで直に入れる方法

   163	7:34	brew edit imagemagick #urlとshaを調整
   164	7:34	brew install -f imagemagick --disable-openmp 
   171	7:39	sudo gem install rmagick

XQuartzが古い

[bob-no-MacBook-Pro:~] bob% brew doctor
Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.5:
  https://xquartz.macosforge.org

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    ruby

packageでinstall.でもdisplayはだめ.

display

displayすると

display: delegate library support not built-in `' (X11) @ error/display.c/DisplayImageCommand/1892.

とのエラーが出る.でも,convertとかは使えているので,viewerをつかって表示.

rmagick

rmagickは

sudo gem install rmagick

で入るが,どこに入っているかわからない.今現在私のmacには,

1.純正ruby,

bob% /usr/bin/ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

2.Tkのときに作ったruby(kitchen timerで使っているだけ,でもhikeもこれでしか動かんな)

bob% /usr/local/bin/ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10.2.0]

3.brewあるいはrbenvで入れかけたruby

bob% /usr/local/Cellar/ruby/2.0.0-p0/bin/ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]

がある.それぞれにgemとかが付属しているはずだが,今は,

bob% which gem
/usr/bin/gem

が動いていて,んん.どうしよう...

とりあえず,imagemagickをsystem callして使ってみるか.

rubygemsのrequire失敗

[bob-no-MacBook-Pro:/usr/lib/ruby] bob% gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.3
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [universal.x86_64-darwin13]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-13
  - GEM PATHS:
     - /Library/Ruby/Gems/2.0.0
     - /Users/bob/.gem/ruby/2.0.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

とすればgem管理のpathが出てくる.rmagickは

ls /Library/Ruby/Gems/2.0.0/gems/rmagick-2.13.2

にあった.直打ち? 

逆に

/usr/bin/ruby rmagick_test.rb

でruby2.0で動かすと動く.

Last modified:2016/07/19 12:42:26
Keyword(s):
References: