現在Gemを作成しています。その際に、guardでテストを実行しようとするとエラーが起きるようになりました。今までは問題なく実行できていて、何が原因となったかはわかりません。test/
以下に~.rb
ファイルがある場合に下記のエラーが起きます。~.rb
ファイルには何も記述していなくてもです。この原因、またはヒントなることがあれば、教えていただきたいです。
/Users/mitsuru/.rbenv/versions/2.3.0/bin/bundle
の22行目のload Gem.activate_bin_path('bundler', 'bundle', version)
からのファイルの読み込みに失敗しています。/Users/mitsuru/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/gems
というディレクトリ自体がありませんでした。
また、Gem.activate_bin_path
の挙動について書いてあるページもわかりませんでした。
どうぞよろしくお願い致します。
bash
1❯ bundle exec guard 221:43:56 - INFO - Guard::Test 2.0.5 is running, with Test::Unit 2.5.5! 321:43:56 - INFO - Running all tests 4/Users/mitsuru/.rbenv/versions/2.3.0/bin/bundle:22:in `load': cannot load such file -- /Users/mitsuru/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/gems/bundler-1.11.2/bin/bundle (LoadError) 5 from /Users/mitsuru/.rbenv/versions/2.3.0/bin/bundle:22:in `<main>' 621:43:57 - INFO - Guard is now watching at '/Users/mitsuru/code/myrepository/dig_yaml_front_matter' 7[1] guard(main)>
環境
OS
- ProductName: Mac OS X
- ProductVersion: 10.11.1
- BuildVersion: 15B42
** その他 **
- zsh 5.2 (x86_64-apple-darwin15.0.0)
- rbenv 1.0.0
- ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
設定ファイル
/Users/mitsuru/.rbenv/versions/2.3.0/bin/bundle
ruby
1#!/Users/mitsuru/.rbenv/versions/2.3.0/bin/ruby 2# 3# This file was generated by RubyGems. 4# 5# The application 'bundler' is installed as part of a gem, and 6# this file is here to facilitate running it. 7# 8 9require 'rubygems' 10 11version = ">= 0.a" 12 13if ARGV.first 14 str = ARGV.first 15 str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding 16 if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then 17 version = $1 18 ARGV.shift 19 end 20end 21 22load Gem.activate_bin_path('bundler', 'bundle', version)
Gemfile
source 'https://rubygems.org' # Specify your gem's dependencies in schema_validator.gemspec gemspec
Gemfile.lock
PATH remote: . specs: dig_yaml_front_matter (0.1.0) front_matter_parser GEM remote: https://rubygems.org/ specs: awesome_print (1.6.1) coderay (1.1.1) fakefs (0.8.1) ffi (1.9.10) formatador (0.2.5) front_matter_parser (0.0.4) guard (2.13.0) formatador (>= 0.2.4) listen (>= 2.7, <= 4.0) lumberjack (~> 1.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) shellany (~> 0.0) thor (>= 0.18.1) guard-test (2.0.5) guard (~> 2.0) test-unit (~> 2.2) listen (3.0.6) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9.7) lumberjack (1.0.10) method_source (0.8.2) nenv (0.3.0) notiffany (0.0.8) nenv (~> 0.1) shellany (~> 0.0) pry (0.10.3) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) rake (10.5.0) rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) shellany (0.0.1) slop (3.6.0) terminal-notifier (1.6.3) terminal-notifier-guard (1.7.0) test-unit (2.5.5) thor (0.19.1) PLATFORMS ruby DEPENDENCIES awesome_print bundler (~> 1.11) dig_yaml_front_matter! fakefs guard guard-test (= 2.0.5) rake (~> 10.0) terminal-notifier terminal-notifier-guard BUNDLED WITH 1.11.2
Guardfile
guard :test, cmd: "bundle exec test" do # Test files watch(%r{^test/.+_test\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" } watch('test/test_helper.rb') { "test" } end
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。