After OS X Yosemite is upgraded: various development environments are fixed.

Source: Internet
Author: User

After OS X Yosemite is upgraded: various development environments are fixed.

This blog post was originally published on my personal blog "Jerry's Paradise".

Finally, I couldn't help upgrading, and the motive force behind my upgrade was actuallyAlfredYosemite theme is much better than the initial theme! Before upgrading, I thought that my development environment would be damaged. So after upgrading the system, check what happened!

 

Problem

As soon as you enter the new system, you will findphpstormKneeling, prompting to installjre6Can be used. Okay, then I gradually find that many things are kneeling. It can only be fixed one by one. Currently, the following error environments are visible:

1. PhpStorm

After the Yosemite is upgraded, Apple will certainly upgrade all the running environment versions based on the average urine usage, and Java is indispensable. Therefore, PhpStorm is placed on the gun. Some people must ask, why?JetBrainsThis kind of jdk used by the most influential IDE vendors in history is so low!

JetBrainsFor example:

Current JDK 1.7 and 1.8 versions have several critical issues. We can’t default to the new JDK version until these issues are resolved.

Okay. The solution is the next jre6! As a result, I found only jre7 and jre8 on the oracle website for half a day. Okay, in fact, directly on the Apple official website can find the download link: http://support.apple.com/kb/DL1572

2. Homebrew

Homebrew cannot run without Ruby. The reason why Homebrew cannot run after upgrade is that the Ruby version built into Yosemite is updated:1.8 => 2.0. To run brew, the following error message is displayed:

/usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

Then, find the solution on the Internet as follows:

2.1 UpdatebrewScript

Open it in your favorite editor/usr/local/bin/brew, And thenbrewComment out a piece of code of the detection system, as shown below:

#BREW_SYSTEM=$(uname -s | tr "[:upper:]" "[:lower:]")#if [ "$BREW_SYSTEM" = "darwin" ]#then#    exec "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"#else    exec ruby -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"#fi
2.2 create a soft link

Homebrew will passRuby 1.8Path to the Ruby runtime environment, but it cannot be found again in Yosemite. So before Homebrew makes some changes, we need to lie to it and establish a falseRuby 1.8The address actually points to the system'sRuby 2.0Running environment.

sudo mkdir -p /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/binsudo ln -s /usr/bin/ruby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
3. node. js

Well, I only found the first two problems when I wrote this blog. But when I usegruntTo automatically generate my blog.env: node: No such file or directoryThis error message. It seems that node has been greatly sacrificed in this upgrade.

In/usr/local/bin/UndernodeAndnpmBut the system still promptsNo such file or directory. At present, I still don't know what the cause is. The final solution is also more violent: Just go to the node official website and install the latest pkg and reinstall it.

4. Apache

Found during local code debuggingApacheAnd cannot be spared. Runapachectl -vApache has been updated2.4.9Version. It must be because of a version update error.

4.1 modify httpd. conf

Open/private/etc/apache2/httpd.confIt seems that the default settings have been restored. Rewrite the following two lines of code:

Include /private/etc/apache2/extra/httpd-vhosts.conf...LoadModule php5_module libexec/apache2/libphp5.so
4.2 modify httpd-vhosts.conf

Openprivate/etc/apache2/extra/httpd-vhosts.confIt seems that the previously set virtual host has not been modified! HoweverApache 2.4The above settings must be adjusted, otherwise you will get403 Forbidden You don't have permission to access / on this serverWrong.

<VirtualHost *:80>    ServerAdmin zry656565@gmail.com    DocumentRoot "/Users/Jerry/Dev/apache/php_tester"    ServerName php_tester    ErrorLog "/Users/Jerry/Dev/apache/php_tester/log/sites-error_log"    CustomLog "/Users/Jerry/Dev/apache/php_tester/log/sites-access_log" common    <Directory />        Options Indexes FollowSymLinks Includes ExecCGI        AllowOverride None        Order deny,allow        Allow from all    </Directory></VirtualHost>

Change

<VirtualHost *:80>    ServerAdmin zry656565@gmail.com    DocumentRoot "/Users/Jerry/Dev/apache/php_tester"    ServerName php_tester    ErrorLog "/Users/Jerry/Dev/apache/php_tester/log/sites-error_log"    CustomLog "/Users/Jerry/Dev/apache/php_tester/log/sites-access_log" common    <Directory />        Options Indexes FollowSymLinks Includes ExecCGI        AllowOverride None        Require all granted    </Directory></VirtualHost>

In factOrder deny,allow, Allow from allChangeRequire all granted.

5. MySQL

Currently, MySQL does not officially support OS X Yosemite. Therefore, after upgrading the system, you will find that the MySQL service is not started in the background. To solve this problem, you only need to manually start MySQL services. We recommend that you~/.bash_profileAdd the following script, and then usesource ~/.bash_profileEnable scripts.

export MYSQL_HOME=/usr/local/mysql/binalias start_mysql='sudo $MYSQL_HOME/mysqld_safe &'alias stop_mysql='sudo $MYSQL_HOME/mysqladmin shutdown'

Next, you only need to usestart_mysqlAndstop_mysqlCommand to switch the mysql service!

Conclusion

In fact, the sixth entry: git. I found that I failed to send this blog post to the github blog! I have been confused for a long time. Later, a project created on gitcafe was successfully pushed. It is not a local git issue, but a github issue. It took a day to send it up!

The above solutions can solve the problem locally. If you have any questions, you can leave a message in the blog, maybe it will help you.

Reference material update
  • Add apache and mysql for restoration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.