📜 ⬆️ ⬇️

How to rubyte survive OSX 10.10 Yosemite update

The next version of OSX 10.10 Yosemite was released the other day, and if the usual “Macs” users don’t need the “upgrade or not” question, then developers may well ask themselves a similar question. A rare big update of past years did not bring us any problems with software, libraries and console. Can not boast of a lack of problems and the current update.

One of the best tips here, of course, would be to wait a month or two and only then update - it will save you from many problems and wasted time. But I don’t want to wait, and therefore after the upgrade everything is guaranteed to break (we’re talking mainly about ruby ​​and rails): seg wards will pop up, some gems will not be collected, problems will arise with scripts in the console.
Fixing some problems will be easy to google, and for some they offer only hacks in the form of setting additional compilation parameters and environment variables.

The author has spent most of the day off on a full system update and setting up the working environment, with the result that the instruction described below was born. If you are a rubist, develops on a poppy and are going to be updated, then following the following points will help you a lot in saving time.

  1. First of all after upgrading OSX, launch Xcode, install the updates and accept the new license.
  2. For some reason, Xcode only has 6.0.1 available in the app, although it takes 6.1 to work properly in Yosemite, so download and install Xcode 6.1 via this link , and then execute
    xcode-select --install 

  3. In Yosemite, they did something with the console, which is why the environment variables in the current terminal session and environment variables are different during the execution of scripts / programs, and if more precisely, the changes made to PATH in ~ / .bashprofile or ~ / .zshrc will be picked up. What is the problem, I do not know, but in practice there are, as it were, 2 PATH variables: the one that contains the changes from your ~ / .bashrc, and the one that is in system by default.
    Because of this, in the console begin to occur a lot of jambs, which are complaining everywhere on the Internet. To avoid confusing problems, you need to explicitly set the login shell "/ usr / bin / login -f your_user_name" in the console settings.

  4. Next, you should update homebrew, which will not work for you because of the 1.8 version of ruby ​​written in it.
     cd /usr/local git pull 

  5. The next item is to install gcc and its dependencies, if you have not had one before.
     brew install gcc 

  6. It's time to upgrade your homebrew packages.
     brew upgrade 

  7. Something may still be wrong, so make sure that the brew doctor does not give any problems.
  8. We update pow , In Yosemite, they sawed some deprecated api used in the old pow.
     curl get.pow.cx | sh 

  9. Now you can reinstall Ruby
     rvm reinstall 2.1.3 

  10. And the last item will be postgres, if you use it of course. In Yosemite, it will stop running for you, and to fix it, create three directories
     mkdir /usr/local/var/postgres/pg_tblspc mkdir /usr/local/var/postgres/pg_twophase mkdir /usr/local/var/postgres/pg_stat_tmp touch /usr/local/var/postgres/pg_tblspc/.keep touch /usr/local/var/postgres/pg_twophase/.keep touch /usr/local/var/postgres/pg_stat_tmp/.keep 


')
After the above manipulations, bundle install in your project should finally correctly work out and collect all the gems without errors.
Have a nice work.

PS Add-ons from comments:


PPS I encountered one more problem: after the update, the Russian language in the rail console broke. To fix this, you need to register in ~ / .zshrc or ~ / .profile
 LANG="ru_RU.UTF-8" LC_COLLATE="ru_RU.UTF-8" LC_CTYPE="ru_RU.UTF-8" LC_MESSAGES="ru_RU.UTF-8" LC_MONETARY="ru_RU.UTF-8" LC_NUMERIC="ru_RU.UTF-8" LC_TIME="ru_RU.UTF-8" LC_ALL="ru_RU.UTF-8" 

Source: https://habr.com/ru/post/240945/


All Articles