インストール
rvm get headrvm reloadrvm install 1.9.3-p0rvm use 1.9.3リリースノート
http://www.ruby-lang.org/ja/news/2011/10/31/ruby-1-9-3-p0-is-released/
速度
結構速くなったらしいです。
この記事を参考:http://stjhimy.com/posts/24-ruby-1-9-3-freaking-fast-bro
rvm get headrvm reloadrvm install 1.9.3-p0rvm use 1.9.3http://www.ruby-lang.org/ja/news/2011/10/31/ruby-1-9-3-p0-is-released/
結構速くなったらしいです。
この記事を参考:http://stjhimy.com/posts/24-ruby-1-9-3-freaking-fast-bro
ruby 1.9.2p290へ更新しました。rvmもついでに。
# update rvm $ rvm get head # or older versions such as 1.0.0 $ rvm update --head # you need to run reload to reflect the update $ rvm reload $ rvm -v rvm 1.7.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]
# install ruby 1.9.2.p290 $ rvm install 1.9.2-p290 ... $ rvm list ruby-1.9.2-p0 ruby-1.9.2-p180 # you need to replace the p0 based on your environment $ rvm upgrade ruby-1.9.2-p0 ruby-1.9.2-p290yes yes yes ... Upgrade complete! $ rvm list ruby-1.9.2-p290 [ x86_64 ] $ rvm --default use 1.9.2$ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]git clone https://github.com/enormego/EGOTextMateFullScreen.git /tmp/EGOTextMateFullScreen xcodebuild -project /tmp/EGOTextMateFullScreen/EGOTextMateFullScreen.xcodeproj -target EGOTextMateFullScreen cp -R /tmp/EGOTextMateFullScreen/build/Release/EGOTextMateFullScreen.tmplugin ~/Library/Application\ Support/TextMate/PlugIns # after installed rm -rf /tmp/EGOTextMateFullScreen/
これが完成図!
coffee-scriptをMacportsを使ってインストールし、TextMateのcoffee-script bundleでコンパイルするメモです。
注意すべきなのはたとえターミナルでcoffeeが実行できても、TextMateはPATHをインクルードしないので(インクルードしているのは/usr/binらしい)、/usr/binにcoffeeのシンボリックを作る必要があります。
またcoffee-scriptをコンパイルするにはnodejsとnpm(Node Package Manager)が前提条件となるため、それらのインストールも必要です。
# don't forget to update your port tree firstsudo port selfupdate
# install coffee script using macportsudo port install nodejsnode -v
# install npm - the Node Package Managergit clone http://github.com/isaacs/npm.gitcd npmsudo make installnpm -v
# now install coffee-script!sudo npm install -g coffee-scriptcoffee -v
# because TextMate doesn't inherit your regular PATH# you need to set a symbol link to /usr/bin# so that you can run coffee in your textmate
which node/opt/local/bin/node
which coffee/opt/local/bin/coffee
cd /usr/binsudo ln -s /opt/local/bin/nodesudo ln -s /opt/local/bin/coffee
# install textmate coffee-script bundlemkdir -p ~/Library/Application\ Support/TextMate/Bundlescd ~/Library/Application\ Support/TextMate/Bundlesgit clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript.tmbundle
# now you can use command + B to compile and display javascript in your textmate!これでtextmateでcommand + Bでコンパイル後のJavascriptが表示できるようになります!
Sinatraを試したところこのようなエラーになりました。
ruby -rubygems myapp.rb no such file to load -- ubygems (LoadError)
ググッてみたらやはりPATHが間違ったっぽいです。
Macportでrubygemsをインストールすることで解決できるそうです。
その後はgemを再度インストールする必要があるらしいです。
操作の流れ:
#パスの確認 which gem /usr/bin/gem sudo port install rb-rubygems ... # Terminal再起動 # パスの確認 which gem /opt/local/bin/gem sudo gem install sinatra
一旦はこれで解決です。
参考になったサイト:
新しい mysqlnd ライブラリは、MySQL 4.1 用の41バイトの新しいパスワードフォーマットを使用します。 古い16バイトのパスワードを使うと、mysql_connect() 系の関数は次のようなエラーメッセージを生成します。”mysqlnd cannot connect to MySQL 4.1+ using old authentication”
MacPortでインストールしたPHP5.3では、
mysqlnd(php5.3のmysql native client)が適用される。
しかし、CentOSなどのyumでインストールできるMySQLサーバーとの相性がよろしくない。
PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using old authentication
というエラーが現れ、接続することができません。
mysqlndを利用しないよう再コンパイルが必要となる。
http://taikimen.blogspot.com/2010/10/snowleopard-php53mysql.html
portでインストールしたモジュールを確認、mysqlndがactiveなってるはず。
sudo port installed php5-mysql @5.3.5_0+mysqlnd (active)
そしてmysql5のvariantsを指定で再インストール。
% sudo port install php5-mysql +mysql5 ---> Computing dependencies for php5-mysql ---> Fetching php5-mysql ---> Verifying checksum(s) for php5-mysql ---> Extracting php5-mysql ---> Configuring php5-mysql ---> Building php5-mysql ---> Staging php5-mysql into destroot ---> Installing php5-mysql @5.3.5_0+mysql5 ---> Deactivating php5-mysql @5.3.5_0+mysqlnd ---> Cleaning php5-mysql ---> Activating php5-mysql @5.3.5_0+mysql5 ---> Cleaning php5-mysql
再度port installedで確認すればmysql5がactiveになるはず。これで解決。
php5-mysql @5.3.5_0+mysqlnd php5-mysql @5.3.5_0+mysql5 (active)
【php】mysqlndを使うとMySQLに接続できない
http://www.softel.co.jp/blogs/tech/archives/2225
SnowLeopard + PHP5.3でのMySQLリモート接続
http://taikimen.blogspot.com/2010/10/snowleopard-php53mysql.html
PHP: mysqlnd cannot connect to MySQL 4.1+ using old authentication
mysqlが古い16バイトのパスワードを使ってるかを確認する方法です。
mysqlにログインして下記コマンドを実行:
mysql> select password('aa');
+------------------+
| password('aa') |
+------------------+
| 0123456789abcdef |
+------------------+
16位だっだら古いです。40位なら新しいってことです。
MacportでPHPをインストールし、CakePHPを動かしたら「Strict Standards」エラーが出ました。
当時のエラー本文は残ってませんので、Googleで検索したエラー本文を貼り付けます。パス以外は同じのはずです。
Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/basics.php on line 279 Strict Standards: Redefining already defined constructor for class Object in /Applications/MAMP/htdocs/xxxx/cake/libs/object.php on line 65 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/object.php on line 92 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/inflector.php on line 65 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/configure.php on line 96 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/configure.php on line 154 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/cache.php on line 71 Strict Standards: Assigning the return value of new by reference is deprecated in /Applications/MAMP/htdocs/xxxx/cake/libs/cache.php on line 157 Strict Standards: Non-static method Configure::getInstance() should not be called statically in /Applications/MAMP/htdocs/xxxx/cake/bootstrap.php on li
これはCakePHPの問題ではなく、PHPのerror_reportingの設定問題だそうです。
php.iniを開いてerror_reportingで検索します。
値をE_ALLに変更すれば解決です。
ちなみにMacportでPHPをインストールしたときのphp.iniパスは/opt/local/etc/php5/php.iniになります。
http://oldblog.awpny.com/2007/12/mamp-php5-cakephp-and-strict-standards/
sudo gem install railsでこんなエラーが出ちゃいました。
Error installing rails bundler requires RubyGems version >= 1.3.6
解決策は
sudo gem update --system pdating RubyGems Updating rubygems-update Successfully installed rubygems-update-1.6.1 Updating RubyGems to 1.6.1 Installing RubyGems 1.6.1 RubyGems 1.6.1 installed === 1.6.1 / 2011-03-03 Bug Fixes: * Installation no longer fails when a dependency from a version that won't be installed is unsatisfied. * README.rdoc now shows how to file tickets and get help. Pull Request #40 by Aaron Patterson. * Gem files are cached correctly again. Patch #29051 by Mamoru Tasaka. * Tests now pass with non-022 umask. Patch #29050 by Mamoru Tasaka. ------------------------------------------------------------------------------ RubyGems installed the following executables: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
を実行した後にsudo gem install railsでrailsをインストールすればOKです。
Oracle Instantclientをインストールすることで、PHPからOracleデータベースへの接続が可能になります。
XAMPPのデフォルトインストールではそれが無効となっています。確認方法はphpinfoのページから’oci8′を検索して何もなかったらつまり接続できてないことです。
phpinfoのページからoci8を検索してあれば成功!
MacにはデフォルトでRubyが入ってそうです。
ターミナルを開いてrails -vを叩いたらバージョン情報が出てきました。
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
そしてRubyだけじゃなくRailsも入ってましてびっくりしました。
すごいですねMacは。。。
て、railsのバージョンもrails -vで確認できますが、
デフォルトのバージョンは古いそうで下記のコマンドでアップグレードできます。
sudo gem update rails
するとこんなログ情報が出ます。
Updating installed gems Updating rails WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren't both writable. WARNING: You don't have /Users/zolo/.gem/ruby/1.8/bin in your PATH, gem executables will not run. Successfully installed activesupport-2.3.8 Successfully installed activerecord-2.3.8 Successfully installed rack-1.1.0 Successfully installed actionpack-2.3.8 Successfully installed actionmailer-2.3.8 Successfully installed activeresource-2.3.8 Successfully installed rails-2.3.8 Gems updated: activesupport, activerecord, rack, actionpack, actionmailer, activeresource, rails Installing ri documentation for activesupport-2.3.8... Installing ri documentation for activerecord-2.3.8... Installing ri documentation for rack-1.1.0... Installing ri documentation for actionpack-2.3.8... Installing ri documentation for actionmailer-2.3.8... Installing ri documentation for activeresource-2.3.8... Installing ri documentation for rails-2.3.8... Installing RDoc documentation for activesupport-2.3.8... Installing RDoc documentation for activerecord-2.3.8... Installing RDoc documentation for rack-1.1.0... Installing RDoc documentation for actionpack-2.3.8... Installing RDoc documentation for actionmailer-2.3.8... Installing RDoc documentation for activeresource-2.3.8... Installing RDoc documentation for rails-2.3.8...
多少時間がかかります。
これでMacでのRuby開発の準備は完了です。
gem update railsにsudoを付けないとこんなエラーが出るかも
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren't both writable. WARNING: You don't have /Users/paku-k/.gem/ruby/1.8/bin in your PATH, gem executables will not run. ERROR: Error installing rails: bundler requires RubyGems version >= 1.3.6