ruby

Mark Anderson mark at macports.org
Mon Mar 20 13:06:01 UTC 2023


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)

—Mark
_______________________
Mark E. Anderson <mark at macports.org>
MacPorts Trac WikiPage <https://trac.macports.org/wiki/mark>
GitHub Profile <https://github.com/markemer>



On Sat, Mar 11, 2023 at 5:57 PM Austin Ziegler <halostatue at gmail.com> wrote:

> Change that to
>
> export
> PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin:$PATH
>
> -a
>
> On Mar 11, 2023, at 14:03, chilli.namesake at gmail.com wrote:
>
> 
> Thank you, I will check that
>
> I have
>
> export
> PATH=$PATH:$HOME/bin:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/X11/bin
>
>
> in my .bash_profile, but echo $PATH shows what you expected:
>
> dude at mac:~$ echo $PATH
>
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dude/bin:/opt/local/bin:/opt/local/sbin...
>
>
> ok, I have something new to work out.
>
> On Mar 11, 2023, at 13:49, Austin Ziegler <halostatue at gmail.com> wrote:
>
> 
> 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.
>
> -a
>
> On Sat, Mar 11, 2023 at 1:46 PM chilli.namesake at gmail.com <
> chilli.namesake at gmail.com> wrote:
>
>> 
>>
>> root at mac:~$ ruby -S gem install coltrane
>> ERROR:  Error installing coltrane:
>> activesupport requires Ruby version >= 2.7.0.
>>
>>
>> Unfortunately, Mojave:
>> ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
>>
>> So I install ruby 2.7.7
>>
>> root at mac:~$ port -vsN install ruby27
>>
>> ....
>> --->  Cleaning ruby27
>> --->  Removing work directory for ruby27
>> --->  Updating database of binaries
>> --->  Scanning binaries for linking errors
>> --->  No broken files found.
>> --->  No broken ports found.
>> --->  Some of the ports you installed have notes:
>> ruby27 has the following notes:
>> To make this the default Ruby (i.e., the version run by the 'ruby', 'gem'
>> or 'bundle' commands), run:
>> sudo port select --set ruby ruby27
>> root at mac:~$ port select --set ruby ruby27
>> Selecting 'ruby27' for 'ruby' succeeded. 'ruby27' is now active.
>> root at mac:~$ ruby -S gem install coltrane
>> ERROR:  Error installing coltrane:
>> activesupport requires Ruby version >= 2.7.0.
>>
>>
>> grrr... it's still trying to use /usr/bin/ruby
>>
>> but
>>
>> root at mac:~$ /opt/local/bin/ruby -S gem install coltrane
>>
>>
>> installed it.
>>
>> 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.
>>
>> Thank you, Austin!
>>
>> On Mar 11, 2023, at 13:14, Austin Ziegler <halostatue at gmail.com> wrote:
>>
>> 
>> I don’t use Macports Ruby (I use `ruby-install`), but try this:
>>
>> sudo ruby -S gem install coltrane
>>
>> Ruby since Ruby 2.x has included Rubygems, and since a bit later than
>> that, Bundler.
>>
>> -a
>>
>> On Sat, Mar 11, 2023 at 1:06 PM chilli.namesake at gmail.com <
>> chilli.namesake at gmail.com> wrote:
>>
>>> Hi,
>>> I need a quick ruby primer, please.
>>>
>>> I'd like to install this,
>>> https://github.com/pedrozath/coltrane
>>>
>>> sudo gem install coltrane
>>>
>>>
>>> won't work because I'm on Mojave with an an ancient ruby and this
>>> requires ruby 2.7 or above.
>>>
>>> sudo port -vsN install ruby
>>>
>>>
>>> installs ruby18 by default
>>>
>>> sudo port -vsN install ruby27
>>> sudo port select --set ruby ruby27
>>>
>>>
>>> installs, but gem still complains.
>>>
>>> just guessing at this point:
>>>
>>> port -vsN install rb-rubygems
>>>
>>>
>>> reinstalls ruby18 ><
>>>
>>>
>>> Help, please.
>>>
>>
>>
>> --
>> Austin Ziegler • halostatue at gmail.comaustin at halostatue.ca
>> http://www.halostatue.ca/http://twitter.com/halostatue
>>
>>
>
> --
> Austin Ziegler • halostatue at gmail.comaustin at halostatue.ca
> http://www.halostatue.ca/http://twitter.com/halostatue
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230320/1643da2f/attachment.htm>


More information about the macports-users mailing list