Just installed Sass on OSX - What is this? > WARNI

2019-08-04 19:19发布

问题:

Not so familiar with Ruby or Sass.

It seems to have been installed, but are there any changes I should make?

WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
  /usr/bin aren't both writable.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:149: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
WARNING:  You don't have /Users/Orion/.gem/ruby/1.8/bin in your PATH,
  gem executables will not run.
Successfully installed sass-3.2.3
1 gem installed
Installing ri documentation for sass-3.2.3...
Installing RDoc documentation for sass-3.2.3...

回答1:

It says what is wrong:

You are using the outdated system ruby that ships with OS X and that is installed outside of your user directory.

So you can

  • Install gems system wide by doing sudo gem install sass
  • Add the bin directory to your PATH by doing this in ~/.bash_profile PATH=$PATH:/Users/Orion/.gem/ruby/1.8/bin export PATH

  • Or what I recommend most: Install RVM which will give you a more modern ruby and make things a lot easier.

To install RVM:

$ \curl -L https://get.rvm.io | bash -s stable --ruby
rvm install 1.9.3
rvm use 1.9.3

That is all you need. Ruby 1.8 can still be used with most projects but as of now there is really no reason to use it unless you have legacy gems/apps. And if you need other rubies, you can easily install them with RVM and switch.



标签: ruby sass