2011-11-29 3 views
22

나는 pry이라는 루비 보석에 screen cast을 팔로우하고 있습니다. 8시 10 분에 .tree 명령이 사용됩니다.이 명령은 유닉스 명령입니다.osx bash에서 tree 명령

그것은 내 시스템에서 작동하는 것으로 나타나지 않습니다

[24] pry(main)> .tree 
\Error: there was a problem executing system command: tree 

내가하는 참조에게 쉘 명령 올립니다, here에 문제를 추적 한 :의 맥락에서

Pry::CommandSet.new do 

    command(/\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>") do |cmd| 
    if cmd =~ /^cd\s+(.+)/i 
     dest = $1 
     begin 
     Dir.chdir File.expand_path(dest) 
     rescue Errno::ENOENT 
     output.puts "No such directory: #{dest}" 
     end 

    else 
     if !system(cmd) 
     output.puts "Error: there was a problem executing system command: #{cmd}" 
     end 
    end 
    end 

을 bash 나는 행운과 명령 트리를 사용하여 시도 :

projects/sms(apps2)$ tree 
-bash: tree: command not found 
~/projects/sms(apps2)$ .tree 
-bash: .tree: command not found 

이것은 incred 보이는 유용하게 사용할 수있는 방법은 무엇입니까? macports 사용

brew install tree

: homebrew를 사용

답변

47

sudo port install tree

the source 사용 :

Follow these directions. (경고 코드; 당신은 플래그/etc를 사용해야합니다. 의미가 있습니다.)

< rant> 모든 시스템은 tree과 함께 제공됩니다. 나는 그것을 많이 사용한다. 그리고 디렉토리 구조를 사진이 아닌 텍스트로 게시 할 수 있습니다. </

관련 문제