2011年11月17日木曜日

rake aborted! cannot load such file -- bundler/setup

以下のエラーが発生した際の対処方法について説明します。

rake aborted!
cannot load such file -- bundler/setup

上記のエラー原因は、bundlerが未インストールのようです。

【参考URL】
http://stackoverflow.com/questions/7483515/rake-aborted-no-such-file-to-load-bundler-setup-rails-3-1

以下のコマンドを実行してインストールします。
C:\Users\yasu\Downloads\Desktop\dbloete-masquerade-fdf8ef1 (2)\dbloete-masquerad
e-fdf8ef1>gem install bundler
Fetching: bundler-1.0.21.gem (100%)
Successfully installed bundler-1.0.21
1 gem installed
Installing ri documentation for bundler-1.0.21...
Installing RDoc documentation for bundler-1.0.21...
C:\Users\yasu\Downloads\Desktop\dbloete-masquerade-fdf8ef1 (2)\dbloete-masquerad
e-fdf8ef1>bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Installing abstract (1.0.0) WARNING: abstract-1.0.0 has an invalid nil value for
 @cert_chain
Installing activesupport (3.0.10)
Installing builder (2.1.2) WARNING: builder-2.1.2 has an invalid nil value for @
cert_chain
Installing i18n (0.5.0)
Installing activemodel (3.0.10)
(以下、略)

で解決と思ったら、以下のエラーが発生しました。。。

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occured while installing json (1.6.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.1'` succeeds before bundling.

ということで、次に、上記の問題を解決します。
対処方法は、「http://memoyasu.blogspot.com/2011/11/ruby-please-update-your-path-to-include.html」を参照してください。

気をとしなおして、bundle installを再実行します。

C:\Users\yasu\Downloads\dbloete-masquerade-fdf8ef1>bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using abstract (1.0.0)
Using activesupport (3.0.10)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.10)
Using erubis (2.6.6)
Using rack (1.2.4)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.31)
Using actionpack (3.0.10)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.10)
Using arel (2.0.10)
Using activerecord (3.0.10)
Using activeresource (3.0.10)
Using bundler (1.0.21)
Using notifiers (1.1.0)
Using watchr (0.7)
Using infinity_test (1.0.3)
Installing json (1.6.1) with native extensions
Installing metaclass (0.0.1)
Installing mocha (0.10.0)
Installing mysql2 (0.2.17) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
        C:/Ruby193/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for main() in -llibmysql... no
*** 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=C:/Ruby193/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-libmysqllib
        --without-libmysqllib

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.
2.17 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.2.17/ext/mysql2/g
em_make.out
An error occured while installing mysql2 (0.2.17), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.2.17'` succeeds before bundling.

またまた、エラーが発生しました。MySQL2のインストールで失敗している模様です。
http://memoyasu.blogspot.com/2011/11/ruby-installing-mysql2-0217-with-native.html」の手順で、gemコマンドを使用してMySQL2を別個にインストールできることを確認します。
再度、bundle installを実行します。

C:\Users\yasu\Downloads\dbloete-masquerade-fdf8ef1>bundle install
Using rake (0.9.2.2)
Using abstract (1.0.0)
Using activesupport (3.0.10)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.10)
Using erubis (2.6.6)
Using rack (1.2.4)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.31)
Using actionpack (3.0.10)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.10)
Using arel (2.0.10)
Using activerecord (3.0.10)
Using activeresource (3.0.10)
Using bundler (1.0.21)
Using notifiers (1.1.0)
Using watchr (0.7)
Using infinity_test (1.0.3)
Using json (1.6.1)
Using metaclass (0.0.1)
Using mocha (0.10.0)
Using mysql2 (0.2.17)
Using rdoc (3.11)
Using thor (0.14.6)
Using railties (3.0.10)
Using rails (3.0.10)
Using ruby-openid (2.1.8)
Using ruby-yadis (0.3.4)
Using sqlite3 (1.3.4)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.

0 件のコメント: