はじめに
簡単な掲示板を作ることにしたので最新を試すことにした。
とりあえずこれに沿ってやる。
http://qiita.com/ms2sato/items/d2bcfe295ceb379ea082
bundle installで下記のエラー!
terminal
$ bundle install --path vendor/bundle
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/ms2/.rbenv/versions/2.1.3/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.
To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions. If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/ms2/.rbenv/versions/2.1.3/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
extconf failed, exit code 1
Gem files will remain installed in /Users/ms2/dev/projects/trainbbs/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.5 for inspection.
Results logged to /Users/ms2/dev/projects/trainbbs/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/gem_make.out
An error occurred while installing nokogiri (1.6.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.5'` succeeds before bundling.
iconv足らないけど?って言われてるっぽい。コメントにそれっぽいことが出ているので下記を試したら「Command Line Tools」をインストールする?って聞かれたのでYES。
$ xcode-select --install
あとは問題なく成功。
springが最初から動くようなのでbin/rake
とかbin/rails
でコマンドを弄れば良いらしい。
$ bin/rails g scaffold comment title:string body:text status:integer
$ bin/rake db:migrate
でとりあえず簡単なコメント掲示板が完成した。ふーーー、つかれたー(何もしていない)。