Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

Getting error after upgrading to MacOS High Sierra #2129

Open ewartx opened 6 years ago

ewartx commented 6 years ago

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 commented 6 years ago

+1 did you come up with a fix?

ewartx commented 6 years ago

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 commented 6 years ago

+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 commented 6 years ago

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

duylinh commented 6 years ago

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 commented 6 years ago

I was able to fix it with a slightly modified answer from https://github.com/oklai/koala/issues/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 commented 6 years ago

Thanks @Mttylzq!

ggonzalezq commented 6 years ago

@ewartx yeah that worked beautiful! thanks,

diansheng commented 6 years ago

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 commented 6 years ago

so much thx, @drewbrolik

himashi99 commented 6 years ago

Thanks so much! @drewbrolik

Kristianaaron commented 6 years ago

Thank thank you @drewbrolik :D

josuevalrob commented 6 years ago

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

Nakilon commented 6 years ago

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 commented 6 years ago

@drewbrolik was the good one for me (y)

begrafx commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

hackthievist commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Relevant SO thread: https://stackoverflow.com/questions/58303940/macos-catalina-error-after-update-unable-to-run-colorls

ViolentStorm commented 4 years ago

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

on macOS Catalina works too for me

martinfrouin commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

mateostabio commented 4 years ago

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