다른 보석이 번들의 일부가 아니기 때문에 보석에서 실행 파일 실행 오류

StackOverflow https://stackoverflow.com//questions/25021077

문제

https://github.com/hamchapman/rewinder 참조 ruby-git ( https://github.com/schacon/ruby-git)이있는 것으로 의존성.

내 보석의 일부는 실행 파일을 가지고 있습니다 https://github.com/hamchapman / rewinder / blob / master / bin / rewinder

기본적으로 메인 lib 파일 "Nofollow"> https : // github가 필요합니다. com / hamchapman / rewinder / blob / master / lib / rewinder.rb

그런 다음 그 방법을 실행합니다 (순간적으로 모든 지저분한 - 지금은 무시합니다).

보석을 로컬로 설치하고 다른 repo에서 사용하면 다음 오류가 발생합니다.

/Users/Hami/.rvm/gems/ruby-2.1.2/gems/git-1.2.7/lib/git/lib.rb:764:in `command': git checkout '6eef72baf24bed761f753267cce16402e4a947f8'  2>&1:Note: checking out '6eef72baf24bed761f753267cce16402e4a947f8'. (Git::GitExecuteError)

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 6eef72b... Trying another bg-color change for homeboy
/Users/Hami/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/rubygems_integration.rb:252:in `block in replace_gem': hookup is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/hookup:22:in `<main>'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/git-1.2.7/lib/git/lib.rb:528:in `checkout'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/git-1.2.7/lib/git/base.rb:325:in `checkout'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/rewinder-0.0.1/lib/rewinder.rb:11:in `block in heloo'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/rewinder-0.0.1/lib/rewinder.rb:10:in `each'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/rewinder-0.0.1/lib/rewinder.rb:10:in `each_with_index'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/rewinder-0.0.1/lib/rewinder.rb:10:in `heloo'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/gems/rewinder-0.0.1/bin/rewinder:4:in `<top (required)>'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/rewinder:23:in `load'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/rewinder:23:in `<main>'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/Hami/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
.

나는 내 보석을 보이지 않는 오류를 정말로 이해하지 못하고 루비 git 보석이 종속성으로 hookup가있다. /Users/Hami/.rvm/gems/ruby-2.1.2/bin/hookup 파일을로드하면

다음과 같이 하단 두 줄을 주석 처리합니다.

#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'hookup' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

#gem 'hookup', version
#load Gem.bin_path('hookup', 'hookup', version)
.

오류가 발생하지 않습니다.

내가 읽은 것처럼 보이는 것처럼 보이는 것처럼 보이는 것처럼 보이는 것처럼 보이는 것처럼 보입니다.

모든 제안?

도움이 되었습니까?

해결책

연결 문서 :

현재 헤드가 변경 될 때마다 holkup은 Gemfile, Gemfile.lock 또는 GEM 사양이 변경되었는지 확인합니다.그렇다면 번들 확인을 실행하고 종속성이 만족하지 않음을 나타내는 경우 번들 설치를 실행합니다.

이에서는 GEM이 git checkout 이벤트를 수신 대기합니다.귀하의 코드 에서이 일을하므로 훅업 후크가 생생 해지고 혼란스러워합니다 (루비 응용 프로그램의 일부인지 여부에 관계없이).

보석을 제거하고 다시 시도하십시오.

이렇게하면 문제가 해결되면 GEM의 저자 에게이 문제를 해결할 수 있도록 문제를 해결할 수 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top