Quick, pay attention to this public number, together with the posture ~
background
Apple recently released a new version of the Mac OS, High Sierra, and Duandian, a software upgrade obsessive, saw it and immediately upgraded. The update didn’t take long, about half an hour, but something happened when Duanjun was ready to develop. Because I used the CSS precompiler SASS, I got an error.
The quick-witted Duanduanjun first asked his colleagues about the problem and found that they had recently encountered the same problem, and the process of solving it was also quite bumpy. The feedback I received was basically that the Ruby version didn’t match. Since Duanduanjuni has done ruby development for a while, it is true that the Mac version is a terrible one. It is best to install a new version, but it is best not to uninstall the original version.
First I’ll update Ruby. Ruby has a version management tool called RVM, which is used for Ruby version management, easy to install.
I first type the following command on the command line:
$ \curl -sSL https://get.rvm.io | bash -s stable
$ source ~/.bashrc
$ source ~/.bash_profile
Then check whether the RVM is installed successfully and execute
RVM – v
If the following output is displayed, the RVM is successfully installed
RVM 1.29.3 (Latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
Then install the new version of Ruby through RVM
RVM install ruby 2.4
Then look at the Ruby version
Ruby – v
Ruby 2.4.1 (2017-03-22 revision 58053) [x86_64-darwin17]
At this point, Duanduanjun thought the problem was solved, ran the previous command, but found the same error.
So I went to Google brother search, may be the Mac recently updated version, the answer is not much. Most of the questions were related to Cocoapods. One of them is more reliable.
Cocoapods is a Ruby gem, but it is a Ruby gem. Looks like I’m getting close to the truth!
First, check gem install -n to see what it means
You can’t find the file in the directory where you want to install the package.
The truth is getting closer!
At this time duan Duan Jun has been unable to resist the impulse of the heart, with the potential of thunderbolt knocked out the following command
Gem install -n /usr/local/bin compass
Problem solved!
Hope the solution works for you, Happy coding~
Welcome to pay attention, get more private hard goods,
Grow together!