Confused with $PATH value for Ruby gems and for npm











up vote
0
down vote

favorite












The following Ruby gems installation way used to work back in the day:



xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
export PATH=/usr/local/bin:$PATH
launchctl setenv PATH “/usr/local/bin:$PATH”
brew install ruby
gem install jekyll


But now on the last step, I get:




ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.




I have tried this solution - https://gist.github.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3. And it sort of worked but now my $PATH is messed up. echo $PATH returns - /Users/username/.rbenv/shims:/Users/username/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.



Is that the expected $PATH? If not, how can I correct it?










share|improve this question




























    up vote
    0
    down vote

    favorite












    The following Ruby gems installation way used to work back in the day:



    xcode-select --install
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    export PATH=/usr/local/bin:$PATH
    launchctl setenv PATH “/usr/local/bin:$PATH”
    brew install ruby
    gem install jekyll


    But now on the last step, I get:




    ERROR: While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.




    I have tried this solution - https://gist.github.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3. And it sort of worked but now my $PATH is messed up. echo $PATH returns - /Users/username/.rbenv/shims:/Users/username/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.



    Is that the expected $PATH? If not, how can I correct it?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      The following Ruby gems installation way used to work back in the day:



      xcode-select --install
      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      export PATH=/usr/local/bin:$PATH
      launchctl setenv PATH “/usr/local/bin:$PATH”
      brew install ruby
      gem install jekyll


      But now on the last step, I get:




      ERROR: While executing gem ... (Gem::FilePermissionError)
      You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.




      I have tried this solution - https://gist.github.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3. And it sort of worked but now my $PATH is messed up. echo $PATH returns - /Users/username/.rbenv/shims:/Users/username/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.



      Is that the expected $PATH? If not, how can I correct it?










      share|improve this question















      The following Ruby gems installation way used to work back in the day:



      xcode-select --install
      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      export PATH=/usr/local/bin:$PATH
      launchctl setenv PATH “/usr/local/bin:$PATH”
      brew install ruby
      gem install jekyll


      But now on the last step, I get:




      ERROR: While executing gem ... (Gem::FilePermissionError)
      You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.




      I have tried this solution - https://gist.github.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3. And it sort of worked but now my $PATH is messed up. echo $PATH returns - /Users/username/.rbenv/shims:/Users/username/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.



      Is that the expected $PATH? If not, how can I correct it?







      ruby path rubygems homebrew






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 15 hours ago









      Holger Just

      35.2k97998




      35.2k97998










      asked 18 hours ago









      alljamin

      499526




      499526
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Don't install ruby with homebrew if you are going to use a ruby version manager, i.e. rbevn.



          I would at this point recommend brew uninstall ruby



          Then use rbenv if you already have it working to install your ruby version.



          But if you are confused and not sure what you're doing, you might wanna consider using RVM instead of RBENV as the install/setup is easier.



          If so see How do you uninstall rbenv on OSX?



          Then see https://rvm.io/rvm/install



          Looking at your gist
          echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc



          You may need to edit your ~/.bashrc and remove that export line



          You will probably want to close and reopen your terminal before doing any of the above. Anything that makes changes to ~/.bashrc won't take effect until you restart your terminal






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237532%2fconfused-with-path-value-for-ruby-gems-and-for-npm%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Don't install ruby with homebrew if you are going to use a ruby version manager, i.e. rbevn.



            I would at this point recommend brew uninstall ruby



            Then use rbenv if you already have it working to install your ruby version.



            But if you are confused and not sure what you're doing, you might wanna consider using RVM instead of RBENV as the install/setup is easier.



            If so see How do you uninstall rbenv on OSX?



            Then see https://rvm.io/rvm/install



            Looking at your gist
            echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc



            You may need to edit your ~/.bashrc and remove that export line



            You will probably want to close and reopen your terminal before doing any of the above. Anything that makes changes to ~/.bashrc won't take effect until you restart your terminal






            share|improve this answer

























              up vote
              0
              down vote













              Don't install ruby with homebrew if you are going to use a ruby version manager, i.e. rbevn.



              I would at this point recommend brew uninstall ruby



              Then use rbenv if you already have it working to install your ruby version.



              But if you are confused and not sure what you're doing, you might wanna consider using RVM instead of RBENV as the install/setup is easier.



              If so see How do you uninstall rbenv on OSX?



              Then see https://rvm.io/rvm/install



              Looking at your gist
              echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc



              You may need to edit your ~/.bashrc and remove that export line



              You will probably want to close and reopen your terminal before doing any of the above. Anything that makes changes to ~/.bashrc won't take effect until you restart your terminal






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Don't install ruby with homebrew if you are going to use a ruby version manager, i.e. rbevn.



                I would at this point recommend brew uninstall ruby



                Then use rbenv if you already have it working to install your ruby version.



                But if you are confused and not sure what you're doing, you might wanna consider using RVM instead of RBENV as the install/setup is easier.



                If so see How do you uninstall rbenv on OSX?



                Then see https://rvm.io/rvm/install



                Looking at your gist
                echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc



                You may need to edit your ~/.bashrc and remove that export line



                You will probably want to close and reopen your terminal before doing any of the above. Anything that makes changes to ~/.bashrc won't take effect until you restart your terminal






                share|improve this answer












                Don't install ruby with homebrew if you are going to use a ruby version manager, i.e. rbevn.



                I would at this point recommend brew uninstall ruby



                Then use rbenv if you already have it working to install your ruby version.



                But if you are confused and not sure what you're doing, you might wanna consider using RVM instead of RBENV as the install/setup is easier.



                If so see How do you uninstall rbenv on OSX?



                Then see https://rvm.io/rvm/install



                Looking at your gist
                echo "export PATH=$HOME/gems/bin:$PATH" >> ~/.bashrc



                You may need to edit your ~/.bashrc and remove that export line



                You will probably want to close and reopen your terminal before doing any of the above. Anything that makes changes to ~/.bashrc won't take effect until you restart your terminal







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 15 hours ago









                lacostenycoder

                3,35111225




                3,35111225






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237532%2fconfused-with-path-value-for-ruby-gems-and-for-npm%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Danny Elfman

                    Lugert, Oklahoma