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 actuallyAlfred
Yosemite 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 findphpstorm
Kneeling, prompting to installjre6
Can 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?JetBrains
This kind of jdk used by the most influential IDE vendors in history is so low!
JetBrains
For 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 Updatebrew
Script
Open it in your favorite editor/usr/local/bin/brew
, And thenbrew
Comment 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.8
Path 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.8
The address actually points to the system'sRuby 2.0
Running 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 usegrunt
To automatically generate my blog.env: node: No such file or directory
This error message. It seems that node has been greatly sacrificed in this upgrade.
In/usr/local/bin/
Undernode
Andnpm
But 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 debuggingApache
And cannot be spared. Runapachectl -v
Apache has been updated2.4.9
Version. It must be because of a version update error.
4.1 modify httpd. conf
Open/private/etc/apache2/httpd.conf
It 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.conf
It seems that the previously set virtual host has not been modified! HoweverApache 2.4
The above settings must be adjusted, otherwise you will get403 Forbidden You don't have permission to access / on this server
Wrong.
<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 all
ChangeRequire 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_profile
Add the following script, and then usesource ~/.bash_profile
Enable 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_mysql
Andstop_mysql
Command 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