Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error after upgrading to MacOS High Sierra #2129

Open
ewartx opened this issue Sep 30, 2017 · 34 comments
Open

Getting error after upgrading to MacOS High Sierra #2129

ewartx opened this issue Sep 30, 2017 · 34 comments

Comments

@ewartx
Copy link

ewartx commented Sep 30, 2017

Whenever a compass command is run on the command line, I get this error:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

@michaelgmiller
Copy link

+1 did you come up with a fix?

@ewartx
Copy link
Author

ewartx commented Oct 4, 2017

High Sierra uses ruby v2.3x as 2.0 seems to be deprecating. I found a workaround that involves installing ruby 2.0 via rvm. https://rvm.io/. Hopefully compass will compatibility in the future.

You can use the follow terminal commands

  1. \curl -sSL https://get.rvm.io | bash -s stable (installs rvm)
  2. rvm install 2.0.0 (installs ruby 2.0)
  3. gem install compass

Compass should work as is afterwards. Good luck

@Mttylzq
Copy link

Mttylzq commented Oct 16, 2017

+1 Sass and Compass all have the same problem. When Install again another problem comes like:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.

@Mttylzq
Copy link

Mttylzq commented Oct 16, 2017

reinstall compass fix it
sudo gem install -n /usr/local/bin compass

@duylinh
Copy link

duylinh commented Nov 17, 2017

After upgrading to macOS High Sierra, get it fixed with following commands:
sudo gem update --system
sudo gem install -n /usr/local/bin cocoapods
once it will be finished then write below command:
pod install
This solution has worked for me...!!!

@drewbrolik
Copy link

I was able to fix it with a slightly modified answer from oklai/koala#679

  1. Open Terminal
  2. Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Do not close Terminal, open Mac Appstore and check Update, install all XCode Command Line Tools updates OR in my case, XCode Command Line Tools started install automaticly throught Terminal right after step 2.
  4. Back to Terminal
  5. Install Ruby: brew install rbenv ruby-build

At this point, install Compass (instead of SASS in original answer)

  1. Install Compass gem: sudo gem install -n /usr/local/bin compass

@FKSI
Copy link

FKSI commented Dec 22, 2017

Thanks @Mttylzq!

@ggonzalezq
Copy link

@ewartx yeah that worked beautiful! thanks,

@diansheng
Copy link

diansheng commented Jan 26, 2018

I read this solution from another site. Mine is the Xcode problem. I have to agree with the xcode license (sudo xcodebuild -license) after update to high Seria. I paste the solution here.

It depends on what each one of us has in her/his box. A quicker way to fix your issue is to read a log file it tells you exactly how to fix it if you have a recent Mac OS version 10.13.2. I read this thread and came across replies that say need to install xcode. I knew I installed xcode but anyways I tried again to install xcode and it says you have it installed. Hence this didn’t fix the issue in my case.

I went back to the error message “failed to build germ native extension” and searched in the bottom for the line where it says look into the log file. In my case the file name is mkmf.log and it gave me the location as well. I opened it and it says right there that “you didn’t agree to xcode …”, and I do have a habit to avoid signing or agreeing on anything so I must have skipped this step when I installed Xcode. It says to execute “sudo xcodebuild -license” which I did and followed the directions to agree. After that I was able to lunch the command “sudo gem install sass” and installed sass successfully.

to sum, each one of us has different setup on her/his machine, and in my humble view the quickest way to resolve the issues is to trust log files and stop ignoring it :slight_smile:

@bebun
Copy link

bebun commented Feb 3, 2018

so much thx, @drewbrolik

@himashi99
Copy link

Thanks so much! @drewbrolik

@Kristianaaron
Copy link

Thank thank you @drewbrolik :D

@josuevalrob
Copy link

josuevalrob commented Feb 23, 2018

$ sudo gem install -n /usr/local/bin compass
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String

@Nakilon
Copy link

Nakilon commented Mar 4, 2018

Not familiar with compass but I've just upgraded to High Sierra and ruby -v was telling me the same error until I did xcode-select --install.

@danielniquet
Copy link

@drewbrolik was the good one for me (y)

@begrafx
Copy link

begrafx commented May 2, 2018

I upgrade to High Sierra a couple of days ago, and after doing so, I found that git wouldn't work. A search of the web lead me to use the xcode-select --install command, which resolved that, however compass still responds with the error mentioned in the original post.

@duylinh : I attempted your method, it ran through a lengthly list of items it installed. I entered, "pod install" and I get the message:

[ ! ] No 'Podfile' found in the project directory.

@drewbrolik 's fix seems to have resolved the issue. Thank you.

@nfranzmeier
Copy link

nfranzmeier commented Jan 22, 2019

duylinh's solution worked for me but I got this error after gem update --system
Installing RubyGems 3.0.2
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem

See: https://stackoverflow.com/questions/47171570/can-not-install-cocoapods-with-rubygem-2-7-1

running it (gem update --system) again came back with no errors and I proceeded.
to run the next command.

After that pod install worked.

This was on High Sierra

@frankfarm
Copy link

I encountered the same as @nfranzmeier but on macOS 10.14.3 Mojave. Second time no error and got the message "Latest version already installed. Done."

@ife-paystack
Copy link

zsh: /usr/local/bin/colorls: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

I had this same issue while trying to use colorls which I installed on Mojave but it happened after updating to Catalina. It appears Mojave uses Ruby v2.3.0 by default and the gems were installed to the associated directory. Catalina however uses 2.6 by default so reinstalling the gem worked well for me.

@cmartinio
Copy link

Hi @ifeoluwa-paystack I am having the same problem after upgrading to catalina. Can you post the solution? Thanks

@hackthievist
Copy link

Hi @fxgx99, it's Ifeoluwa with a different account. What worked for me was running gem install colorls again. That installed it into the gem folder for Ruby 2.6 and everything started working fine.

I do not know if it's related but before I did this, I installed the xcode command line tools. I had to do that when I updated from Sierra to High Sierra and from High Sierra to Mojave so it was the first thing I did before anything else.

xcode-select --install

@cmartinio
Copy link

I am getting the same error message as the one in your post above. Except when I do gem install colorsls I get the error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

And when I do xcode-select --install I get: xcode-select: error: command line tools are already installed, use "Software Update" to install updates I am not sure where to got from here

@hackthievist
Copy link

hackthievist commented Oct 9, 2019

@fxgx99, you need to run the command as super user, I forgot to mention. sudo gem install colorls which prompts you for your password. Once you provide that, it gets installed.

It appears you have the command line tools installed so you do not need to run the xcode-select --install command.

@cmartinio
Copy link

Sorry I forgot to mention that I am running the gem install colorls with sudo and still getting the same error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.

@alechp
Copy link

alechp commented Oct 9, 2019

I had the same issue
rbenv rehash fixed it for me. Here's a PDF containing my entire terminal log session if you want to see everything I tried before:

Colorls - macOS Catalina.pdf

You can search for ❯ to quickly jump through the commands tried, as seen here:
Screen Shot 2019-10-09 at 1 45 54 PM

Note: this fixes the inline issue

zsh: /Users/alechp/.gem/ruby/2.3.0/bin/colorls: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

however, there still seems to be an issue with sourcing the autocomplete path (ie. source $(dirname $(gem which colorls))/tab_complete.sh per colorls install guide) upon opening a new terminal:

Screen Shot 2019-10-09 at 1 48 45 PM

@cmartinio
Copy link

Hi @alechp unfortunately it still doesn't work. I "think" that I am struggling to link colorls to the 2.6 ruby version which comes with Catalina. Because the error message actually says the 2.3 version is no longer there. The installation must have removed it. Below is the screenshots of my error messages: Any help will be appreciated
Screen Shot 2019-10-09 at 5 43 55 PM
Screen Shot 2019-10-09 at 5 42 25 PM

@cmartinio
Copy link

I finally found a solution: so here is my solution for Catalina upgrade issue: I decided to reinstall everything: Install rvm from terminal: \curl -sSL https://get.rvm.io | bash -s stable
After installation complete, source the script with source /Users/{username}/.rvm/scripts/rvm
Install the ruby version: rvm install 2.6.5
now with right ruby version in place you should be able to install gems for the version you've chosen, mine was:
gem install colorls

And voila....

@alechp
Copy link

alechp commented Oct 10, 2019

@ViolentStorm
Copy link

reinstall compass fix it
sudo gem install -n /usr/local/bin compass

on macOS Catalina works too for me

@martinfrouin
Copy link

reinstall compass fix it
sudo gem install -n /usr/local/bin compass

on macOS Catalina works too for me

Same for cocoapods:

sudo gem install -n /usr/local/bin cocoapods

@mallampati434
Copy link

Hi
I am still seeing same issue
zsh: /usr/local/bin/foreman: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

can fix for this, i tried every thing

@jfols
Copy link

jfols commented Nov 11, 2019

I hackily fixed this issue by manually editing the pod script file vi $(which pod), replace the shebang with the result of which ruby...for example,#!/usr/bin/ruby.

@gurjnderSingh
Copy link

Run below command
gurjindersingh$ sudo gem install -n /usr/local/bin cocoapods
Then set command-line tools under locations in Xcode preferences.

@mateostabio
Copy link

This link and all of the above helped me solve this. Thanks!
https://superuser.com/a/1490984/1141917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests