1
다음은 Rails 4 앱의 레이크 작업입니다.heroku에서 명령 줄 명령을 실행하는 방법
task :traceroute_ip => :environment do
puts "start.........................."
ip = IpAddress.first
ip_address_output = `traceroute -q 1 -n google.com`
ip.update_attributes(traceroute_output: ip_address_output)
end
내 Rails 앱 레이크 작업에서 로컬로 올바르게 작동하는 아래 행에 오류가 있습니다.
ip_address_output = `traceroute -q 1 -n google.com`
오류가
/app/vendor/bundle/ruby/2.0.0/bin/rake: No such file or directory - traceroute
명령 아래에이 내가 Heroku가의 "경로 추적을"어떻게 설치할 수있는 우분투 터미널
traceroute -q 1 -n google.com
에서 실행됩니다입니까?
sudo apt-get install traceroute
감사
. 이 내용이 담긴 두 개의 파일 .buildpack 텍스트 파일을 https://github.com/ddollar/heroku-buildpack-apt https://github.com/heroku/heroku-buildpack-ruby 및이 traceroute가있는 APtfile 파일을 추가하십시오. 그런 다음 아래의 히로쿠로 밀어 넣으면 – Kashiftufail
을 배포 할 때 내 모든 출력물이됩니다.이 작업 후 176kB의 추가 디스크 공간이 사용됩니다. Get : 1 http://archive.ubuntu.com/ubuntu/ trusty/universe traceroute amd64 1 : 2.0.19-3 [44.6 kB] 0 (658 kB/s)에서 44.6 kB를 가져옵니다. 다운로드 완료 및 다운로드 전용 모드 -----> traceroute_1 % 3a2.0.19-3_amd64.deb 설치 -----> 프로필 스크립트 작성 =====> Buildpack 다운로드 : https://github.com/heroku/heroku -buildpack 루비 =====> 감지 프레임 워크 : 당신이 경로 추적을 볼 수 있습니다 위의 코멘트에서 루비 – Kashiftufail
아래에 설치 한 내 레이크 작업입니다 : traceroute_ip => 환경 을두고 않습니다 "시작 ....... ................... " 는'traceroute -q 1 -n google.com'을 넣습니다. 끝 오류가 발생합니다. "/app/vendor/bundle/ruby/2.0.0/bin/rake : 해당 파일이나 디렉토리가 없습니다. - traceroute" 도움이 필요하십니까? – Kashiftufail