iOct
V2EX  ›  问与答

如何确定 zsh 中定义的函数是在那个文件中的?

  •  
  •   iOct · Jul 17, 2014 · 2881 views
    This topic created in 4347 days ago, the information mentioned may be changed or developed.
    今天遇到一个妖孽的问题,一台MBPR上安装了zsh shell,使用.dotfile作为配置文件,随后使用最新版的rvm安装了ruby2.1.2和ruby2.0.0(默认),再使用gem install 安装完rails后,运行rails --version没有任何反应(确定是安装成功的),随键入whereis rails查看,发现如下返回结果:
    rails () {
    pwd > ~/.save_dir
    }
    /Users/xx/.rvm/gems/ruby-2.0.0-p481@rails4tutorial/bin/rails
    /usr/bin/rails

    我把所有的zsh的配置文件(在.dotfile内的)翻了个遍,都没有找到一个rails()的定义信息。
    并且我尝试把rvm的path申明放到配置文件的最上面,但是都没有效果...
    搞了很久,实在是无解...
    2 replies    2014-07-19 17:21:21 +08:00
    siteshen
        1
    siteshen  
       Jul 19, 2014
    which rails
    iOct
        2
    iOct  
    OP
       Jul 19, 2014
    @siteshen
    显示这个结果:
    rails () {
    pwd > ~/.save_dir
    }
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2677 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 12:18 · PVG 20:18 · LAX 05:18 · JFK 08:18
    ♥ Do have faith in what you're doing.