<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">bash_profile is executed for login
      shells, so it shouldn't be sourced more than once per login.<br>
      <br>
      On 3/20/23 11:49 AM, <a class="moz-txt-link-abbreviated" href="mailto:chilli.namesake@gmail.com">chilli.namesake@gmail.com</a> wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:EFA18A1B-81B8-4145-8883-D85410B75990@gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I was checking. echo $PATH reports correctly. If I
        source the .bash_profile more than once, however, I get
        duplicates.</div>
      <div dir="ltr"><br>
        <blockquote type="cite">On Mar 20, 2023, at 12:44, Will Senn
          <a class="moz-txt-link-rfc2396E" href="mailto:will.senn@gmail.com"><will.senn@gmail.com></a> wrote:<br>
          <br>
        </blockquote>
      </div>
      <blockquote type="cite">
        <div dir="ltr">
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8">
          <div class="moz-cite-prefix">Sounds like you should check
            $PATH before and after the change to see what it's actually
            doing. Whatever you want to run, say your version of ruby in
            /some/dir/ruby, needs to appear earlier in the path than the
            system version, say /usr/bin/ruby... period. It's not rocket
            science. However, it's not totally straightforward, either.
            Some updated  command locations require that the shell be
            rehashed after changing the path cuz the shell may cache the
            location - <font face="monospace">hash -r,</font> or
            equivalent. That said, it's usually pilot error messing with
            path.<br>
            <br>
            echo "PATH: $PATH"<br>
            before setting and after to see what's going on. then it's
            just a matter of figuring out which ruby comes first.<br>
            <br>
            Will<br>
            <br>
            On 3/20/23 11:33 AM, <a class="moz-txt-link-abbreviated
              moz-txt-link-freetext"
              href="mailto:chilli.namesake@gmail.com"
              moz-do-not-send="true">chilli.namesake@gmail.com</a>
            wrote:<br>
          </div>
          <blockquote type="cite"
            cite="mid:18BDE940-BDEE-4B5C-A689-E2F28E3A723A@gmail.com">
            <meta http-equiv="content-type" content="text/html;
              charset=UTF-8">
            <div dir="ltr">This is the only way I can get it to work
              right without error</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">
              <div dir="ltr">
                <blockquote type="cite">export
PATH="$PATH:$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"</blockquote>
              </div>
              <div><br>
              </div>
            </div>
            <div dir="ltr">It doesn't like :$PATH at the end</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr"><br>
              <blockquote type="cite">On Mar 20, 2023, at 09:27, <a
                  class="moz-txt-link-abbreviated moz-txt-link-freetext"
                  href="mailto:chilli.namesake@gmail.com"
                  moz-do-not-send="true">chilli.namesake@gmail.com</a>
                wrote:<br>
                <br>
              </blockquote>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <meta http-equiv="content-type" content="text/html;
                  charset=UTF-8">
                <div dir="ltr">I am closer, but my $PATH is still messed
                  up.</div>
                <div dir="ltr"><br>
                </div>
                <div dir="ltr">This in .bash_profile</div>
                <div dir="ltr"><br>
                </div>
                <div dir="ltr">
                  <div dir="ltr">
                    <blockquote type="cite">export
PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH</blockquote>
                  </div>
                  <div><br>
                  </div>
                  <div>gets me this when I source it</div>
                </div>
                <div dir="ltr"><br>
                </div>
                <div dir="ltr">
                  <blockquote type="cite">
                    <div dir="ltr"><b>env: bash: No such file or
                        directory</b></div>
                    <div dir="ltr">dude@mac:~/Extra/sand$ echo $PATH</div>
                    <div dir="ltr">/Users/dude/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:</div>
                  </blockquote>
                  <div><br>
                  </div>
                </div>
                <div dir="ltr">notice the trailing ":" </div>
                <div dir="ltr">removing it gets me a no such directory
                  error for "/sbin$PATH"</div>
                <div dir="ltr"><br>
                </div>
                <div dir="ltr"><br>
                  <blockquote type="cite">On Mar 20, 2023, at 09:04,
                    Mark Anderson <a class="moz-txt-link-rfc2396E"
                      href="mailto:emer@emer.net" moz-do-not-send="true"><emer@emer.net></a>
                    wrote:<br>
                    <br>
                  </blockquote>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div dir="ltr">Yeah, this is the answer. You always
                      want `/opt/local/bin/` to be near the start of
                      your path. Only stuff that you specifically want
                      to override MacPorts should be before it.
                      (Examples of things you may want before: RVM or
                      NVM or any of the version managers that put things
                      in your home)
                      <div>
                        <div><br clear="all">
                          <div>
                            <div dir="ltr" class="gmail_signature"
                              data-smartmail="gmail_signature">
                              <div dir="ltr">
                                <div>Thanks,</div>
                                <div>—Mark<br>
                                  _______________________<br>
                                  Mark E. Anderson <<a
                                    href="mailto:emer@emer.net"
                                    target="_blank"
                                    moz-do-not-send="true"
                                    class="moz-txt-link-freetext">emer@emer.net</a>><br>
                                </div>
                                <div><a
                                    href="https://www.linkedin.com/in/markemer/"
                                    target="_blank"
                                    moz-do-not-send="true">Find me on
                                    LinkedIn</a><br>
                                </div>
                              </div>
                            </div>
                          </div>
                          <br>
                        </div>
                      </div>
                    </div>
                    <br>
                    <div class="gmail_quote">
                      <div dir="ltr" class="gmail_attr">On Sat, Mar 11,
                        2023 at 5:57 PM Austin Ziegler <<a
                          href="mailto:halostatue@gmail.com"
                          moz-do-not-send="true"
                          class="moz-txt-link-freetext">halostatue@gmail.com</a>>
                        wrote:<br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px 0.8ex;border-left:1px solid
                        rgb(204,204,204);padding-left:1ex">
                        <div dir="auto">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div>Change that to</div>
                              <div><br>
                              </div>
                              <div>export
PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin:$PATH</div>
                            </div>
                          </div>
                          <br>
                          <div dir="ltr">
                            <div><span>-a</span></div>
                          </div>
                          <div dir="ltr"><br>
                            <blockquote type="cite">On Mar 11, 2023, at
                              14:03, <a
                                href="mailto:chilli.namesake@gmail.com"
                                target="_blank" moz-do-not-send="true"
                                class="moz-txt-link-freetext">chilli.namesake@gmail.com</a>
                              wrote:<br>
                              <br>
                            </blockquote>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">
                              <div dir="ltr">Thank you, I will check
                                that</div>
                              <div dir="ltr"><br>
                              </div>
                              <div dir="ltr">I have</div>
                              <div dir="ltr"><br>
                              </div>
                              <div dir="ltr">
                                <blockquote type="cite">export
PATH=$PATH:$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin</blockquote>
                              </div>
                              <div dir="ltr"><br>
                              </div>
                              <div dir="ltr">in my .bash_profile, but
                                echo $PATH shows what you expected:</div>
                              <div dir="ltr"><br>
                              </div>
                              <div dir="ltr">
                                <blockquote type="cite">
                                  <div dir="ltr">dude@mac:~$ echo $PATH</div>
                                  <div dir="ltr">/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dude/bin:/opt/local/bin:/opt/local/sbin...</div>
                                </blockquote>
                                <div dir="ltr"><br>
                                </div>
                                <div dir="ltr">ok, I have something new
                                  to work out.</div>
                              </div>
                              <div dir="ltr"><br>
                                <blockquote type="cite">On Mar 11, 2023,
                                  at 13:49, Austin Ziegler <<a
                                    href="mailto:halostatue@gmail.com"
                                    target="_blank"
                                    moz-do-not-send="true"
                                    class="moz-txt-link-freetext">halostatue@gmail.com</a>>
                                  wrote:<br>
                                  <br>
                                </blockquote>
                              </div>
                              <blockquote type="cite">
                                <div dir="ltr">
                                  <div dir="ltr">No problem. The system
                                    ruby showing up instead of
                                    MacPorts-installed Ruby would be
                                    *probably* because your $PATH has
                                    `/opt/local/bin` *after* `/usr/bin`.
                                    Typically, one wants to have
                                    Macports (or other third-party
                                    package systems) *before*
                                    /usr/local/bin and /usr/bin.
                                    <div><br>
                                    </div>
                                    <div>-a</div>
                                  </div>
                                  <br>
                                  <div class="gmail_quote">
                                    <div dir="ltr" class="gmail_attr">On
                                      Sat, Mar 11, 2023 at 1:46 PM <a
                                        href="mailto:chilli.namesake@gmail.com"
                                        target="_blank"
                                        moz-do-not-send="true"
                                        class="moz-txt-link-freetext">chilli.namesake@gmail.com</a>
                                      <<a
                                        href="mailto:chilli.namesake@gmail.com"
                                        target="_blank"
                                        moz-do-not-send="true"
                                        class="moz-txt-link-freetext">chilli.namesake@gmail.com</a>>
                                      wrote:<br>
                                    </div>
                                    <blockquote class="gmail_quote"
                                      style="margin:0px 0px 0px
                                      0.8ex;border-left:1px solid
                                      rgb(204,204,204);padding-left:1ex">
                                      <div dir="auto">
                                        <div dir="ltr">
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">
                                            <blockquote type="cite">
                                              <div dir="ltr">root@mac:~$
                                                ruby -S gem install
                                                coltrane</div>
                                              <div dir="ltr">ERROR:
                                                 Error installing
                                                coltrane:</div>
                                              <div dir="ltr">
                                                activesupport requires
                                                Ruby version >=
                                                2.7.0.</div>
                                            </blockquote>
                                          </div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">Unfortunately,
                                            Mojave:</div>
                                          <div dir="ltr">ruby 2.3.7p456
                                            (2018-03-28 revision 63024)
                                            [universal.x86_64-darwin18]</div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">So I install
                                            ruby 2.7.7</div>
                                          <br>
                                          <div dir="ltr">
                                            <blockquote type="cite"><span
                                                style="color:rgb(0,0,0)">root@mac:~$
                                                port -vsN install ruby27</span></blockquote>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">....</div>
                                            <div dir="ltr">
                                              <div dir="ltr">--->
                                                 Cleaning ruby27</div>
                                              <div dir="ltr">--->
                                                 Removing work directory
                                                for ruby27</div>
                                              <div dir="ltr">--->
                                                 Updating database of
                                                binaries</div>
                                              <div dir="ltr">--->
                                                 Scanning binaries for
                                                linking errors</div>
                                              <div dir="ltr">--->  No
                                                broken files found.</div>
                                              <div dir="ltr">--->  No
                                                broken ports found.</div>
                                              <div dir="ltr">--->
                                                 Some of the ports you
                                                installed have notes:</div>
                                              <div dir="ltr"> ruby27 has
                                                the following notes:</div>
                                              <div dir="ltr"> To make
                                                this the default Ruby
                                                (i.e., the version run
                                                by the 'ruby', 'gem' or
                                                'bundle' commands), run:</div>
                                              <div dir="ltr"> sudo port
                                                select --set ruby ruby27</div>
                                              <div dir="ltr">root@mac:~$
                                                port select --set ruby
                                                ruby27</div>
                                              <div dir="ltr">Selecting
                                                'ruby27' for 'ruby'
                                                succeeded. 'ruby27' is
                                                now active.</div>
                                              <div dir="ltr">root@mac:~$
                                                ruby -S gem install
                                                coltrane</div>
                                              <div dir="ltr">ERROR:
                                                 Error installing
                                                coltrane:</div>
                                              <div dir="ltr">
                                                activesupport requires
                                                Ruby version >=
                                                2.7.0.</div>
                                            </div>
                                          </blockquote>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">grrr... it's
                                            still trying to use
                                            /usr/bin/ruby</div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">but</div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">
                                            <blockquote type="cite">
                                              <div dir="ltr">
                                                <div dir="ltr">root@mac:~$
                                                  /opt/local/bin/ruby -S
                                                  gem install coltrane</div>
                                              </div>
                                            </blockquote>
                                            <br>
                                          </div>
                                          <div dir="ltr">installed it.</div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">idky my ruby
                                            $PATH seems stuck on
                                            /usr/bin/ruby, but thanks to
                                            your tip, I was able to
                                             install coltrane, and it
                                            seems to be working. Neato
                                            CLI music utility.</div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr">Thank you,
                                            Austin!</div>
                                          <div dir="ltr"><br>
                                            <blockquote type="cite">On
                                              Mar 11, 2023, at 13:14,
                                              Austin Ziegler <<a
                                                href="mailto:halostatue@gmail.com"
                                                target="_blank"
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext">halostatue@gmail.com</a>>
                                              wrote:<br>
                                              <br>
                                            </blockquote>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">
                                              <div dir="ltr">I don’t use
                                                Macports Ruby (I use
                                                `ruby-install`), but try
                                                this:
                                                <div><br>
                                                </div>
                                                <div>sudo ruby -S gem
                                                  install coltrane</div>
                                                <div><br>
                                                </div>
                                                <div>Ruby since Ruby 2.x
                                                  has included Rubygems,
                                                  and since a bit later
                                                  than that, Bundler.</div>
                                                <div><br>
                                                </div>
                                                <div>-a</div>
                                              </div>
                                              <br>
                                              <div class="gmail_quote">
                                                <div dir="ltr"
                                                  class="gmail_attr">On
                                                  Sat, Mar 11, 2023 at
                                                  1:06 PM <a
                                                    href="mailto:chilli.namesake@gmail.com"
                                                    target="_blank"
                                                    moz-do-not-send="true"
class="moz-txt-link-freetext">chilli.namesake@gmail.com</a> <<a
                                                    href="mailto:chilli.namesake@gmail.com"
                                                    target="_blank"
                                                    moz-do-not-send="true"
class="moz-txt-link-freetext">chilli.namesake@gmail.com</a>> wrote:<br>
                                                </div>
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0px 0px
                                                  0px
                                                  0.8ex;border-left:1px
                                                  solid
rgb(204,204,204);padding-left:1ex">
                                                  <div dir="auto">Hi,
                                                    <div>I need a quick
                                                      ruby primer,
                                                      please.</div>
                                                    <div><br>
                                                    </div>
                                                    <div>I'd like to
                                                      install this,</div>
                                                    <div><a
                                                        href="https://github.com/pedrozath/coltrane"
                                                        target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/pedrozath/coltrane</a></div>
                                                    <div><br>
                                                    </div>
                                                    <div>
                                                      <blockquote
                                                        type="cite">sudo
                                                        gem install
                                                        coltrane</blockquote>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div>won't work
                                                      because I'm on
                                                      Mojave with an an
                                                      ancient ruby and
                                                      this requires ruby
                                                      2.7 or above.</div>
                                                    <div><br>
                                                    </div>
                                                    <div>
                                                      <blockquote
                                                        type="cite">sudo
                                                        port -vsN
                                                        install ruby</blockquote>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div>installs ruby18
                                                      by default</div>
                                                    <div><br>
                                                    </div>
                                                    <blockquote
                                                      type="cite">
                                                      <div>sudo port
                                                        -vsN install
                                                        ruby27</div>
                                                      <div>sudo port
                                                        select --set
                                                        ruby ruby27</div>
                                                    </blockquote>
                                                    <div><br>
                                                    </div>
                                                    <div>installs, but
                                                      gem still
                                                      complains.</div>
                                                    <div><br>
                                                    </div>
                                                    <div>just guessing
                                                      at this point:</div>
                                                    <div>
                                                      <blockquote
                                                        type="cite">port
                                                        -vsN install
                                                        rb-rubygems</blockquote>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div>reinstalls
                                                      ruby18 ><</div>
                                                    <div><br>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div>Help, please.</div>
                                                  </div>
                                                </blockquote>
                                              </div>
                                              <br clear="all">
                                              <div><br>
                                              </div>
                                              <span>-- </span><br>
                                              <div dir="ltr">Austin
                                                Ziegler • <a
                                                  href="mailto:halostatue@gmail.com"
                                                  target="_blank"
                                                  moz-do-not-send="true"
class="moz-txt-link-freetext">halostatue@gmail.com</a> • <a
                                                  href="mailto:austin@halostatue.ca"
                                                  target="_blank"
                                                  moz-do-not-send="true"
class="moz-txt-link-freetext">austin@halostatue.ca</a><br>
                                                <a
                                                  href="http://www.halostatue.ca/"
                                                  target="_blank"
                                                  moz-do-not-send="true"
class="moz-txt-link-freetext">http://www.halostatue.ca/</a> • <a
                                                  href="http://twitter.com/halostatue"
                                                  target="_blank"
                                                  moz-do-not-send="true"
class="moz-txt-link-freetext">http://twitter.com/halostatue</a></div>
                                            </div>
                                          </blockquote>
                                        </div>
                                      </div>
                                    </blockquote>
                                  </div>
                                  <br clear="all">
                                  <div><br>
                                  </div>
                                  <span>-- </span><br>
                                  <div dir="ltr">Austin Ziegler • <a
                                      href="mailto:halostatue@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true"
                                      class="moz-txt-link-freetext">halostatue@gmail.com</a>
                                    • <a
                                      href="mailto:austin@halostatue.ca"
                                      target="_blank"
                                      moz-do-not-send="true"
                                      class="moz-txt-link-freetext">austin@halostatue.ca</a><br>
                                    <a href="http://www.halostatue.ca/"
                                      target="_blank"
                                      moz-do-not-send="true"
                                      class="moz-txt-link-freetext">http://www.halostatue.ca/</a>
                                    • <a
                                      href="http://twitter.com/halostatue"
                                      target="_blank"
                                      moz-do-not-send="true"
                                      class="moz-txt-link-freetext">http://twitter.com/halostatue</a></div>
                                </div>
                              </blockquote>
                            </div>
                          </blockquote>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </blockquote>
              </div>
            </blockquote>
          </blockquote>
          <br>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>