developer tip

"bin / rails : 해당 파일 또는 디렉토리 없음", Heroku의 Ruby 2 및 Rails 4 포함

copycodes 2020. 12. 14. 20:02
반응형

"bin / rails : 해당 파일 또는 디렉토리 없음", Heroku의 Ruby 2 및 Rails 4 포함


Michael Hartl의 Ruby on Rails TutorialRails 4 베타 버전을 따르는 동안 내 앱이 Heroku에서 시작되지는 않지만 로컬에서 . 확인 하면 다음 오류가 나타납니다.bundle exec rails serverheroku logs -t

$ heroku[web.1]: State changed from crashed to starting
$ heroku[web.1]: Starting process with command `bin/rails server 
-p 33847 -e $RAILS_ENV`
$ app[web.1]: bash: bin/rails: No such file or directory
$ heroku[web.1]: Process exited with status 127
$ heroku[web.1]: State changed from starting to crashed
$ heroku[web.1]: Error R99 (Platform error) -> Failed to launch the 
dyno within 10 seconds
$ heroku[web.1]: Stopping process with SIGKILL

나는 경우 heroku run bash와는 확인 bin디렉토리를, 나는이 있음을 볼 수 없습니다rails 실행 :

~$ ls bin
erb  gem  irb  node rdoc  ri  ruby  testrb

내가 뭘 잘못 했어? 나는 튜토리얼을 정확하게 따랐다.


레일 4.0.0으로 업그레이드 한 이후에도이 문제가 발생했습니다.

이 명령 실행

rake rails:update:bin

자세한 정보는 여기로 이동하십시오 https://devcenter.heroku.com/articles/rails4


이것으로 조금 고생 한 후, 나는 /bin내가 복제했던 일부 오래된 Rails 3 프로젝트와 달리 내 Rails 4 프로젝트에 디렉토리 가 있다는 것을 알았다 . /bin포함 3 개 개의 파일은, bundle, rails, 그리고 rake내가했기 때문에, 그러나 이들은 Heroku가로 제작되지 않은 bin내 전역에서 .gitignore파일.

이것은 Git 및 기타 언어 (Java 등)로 작업하는 경우 매우 일반적인 무시 규칙이므로이를 수정하려면 다음을 수행하십시오.

  1. 제거 bin에서~/.gitignore
  2. 운영 bundle install
  3. 변경 사항을 git add .git commit -m "Add bin back"
  4. 변경 사항을 Heroku에 푸시하십시오. git push heroku master

단계 :

  1. bundle config --delete bin # Bundler의 스텁 생성기 끄기

  2. rake rails:update:bin # 새로운 Rails 4 실행 파일 사용

  3. git add bin or git add bin -f # 소스 제어에 bin / 추가

  4. git commit -a -m "you commit message"

  5. git push heroku master

  6. heroku open


~/bin디렉토리 에 대한 권한 644755. rake rails:update:bin로컬에서 (Mac / * nix에서) 실행 한 다음 변경 사항을 푸시하면 문제가 해결되었습니다.


rails 4 앱에 myapp / bin 디렉토리가 없었기 때문에 하나를 만든 다음 my app / script / rails 파일과 rvm / ruby ​​/ bin 아래의 번들 및 레이크 파일에 복사 한 다음 추가했습니다. git의 repo로 이동하여 heroku까지 밀어 넣었고 모든 것이 잘되었습니다.


나는 당신이했던 것과 똑같은 문제가있었습니다. 문제는 bin 폴더가 heroku 저장소로 푸시되지 않았다는 사실에 있습니다.

.gitignore 파일에 bin / 폴더에 대한 규칙이 없었습니다.

Then, after a lot of pain and anguish, I realized that a couple of months before I had created a global .gitignore that would ignore all bin folders of all my repositories (why lord, why??).

I deleted the global .gitignore, and everything worked fine.


I can confirm running rake rails:update:bin works, as said by @Ryan Taylor.

I think I had this problem because I originally created this Rails app on Windows. Running the command above on Linux solved for me.

Also, on changing from Windows to Linux for development, it is a good idea to delete Gemfile.lock file and run bundle install to generate it again without Windows specific gems listed there.

참고URL : https://stackoverflow.com/questions/17583439/bin-rails-no-such-file-or-directory-w-ruby-2-rails-4-on-heroku

반응형