開発環境構築の続き(未完)
herokuにruby1.9.3-p194は使えないと言われてしまったので、
ruby1.9.3-p125のインストールを試みる。
注意
本ブログは最後まで出来ていないので、手っ取り早く構築したい人は以下を参照
Rails3.2とRuby1.9.3-p125でheroku - ものごとの調査記録
本題
前のブログで説明したように、diffファイルを削除してからインストールしたら、あっさり通った
rm ~/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff
rvm reinstall 1.9.3-p125
rvm use 1.9.3-p125 --default
macを買って、今すぐherokuでruby1.9.3 + rails3.2しよう! - ppworks blog
これの「rvm gemset作成」からやり直し。
heroku上でrailsのdefault pageを表示するところまではたどり着いた。
その後にscaffoldを使ってブックマークアプリを作るところでmysqlのエラーが出た
/Users/pandazx/.rvm/gems/ruby-1.9.3-p125@heroku-sample/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': dlopen(/Users/pandazx/.rvm/gems/ruby-1.9.3-p125@heroku-sample/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/pandazx/.rvm/gems/ruby-1.9.3-p125@heroku-sample/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/pandazx/.rvm/gems/ruby-1.9.3-p125@heroku-sample/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
requireでOpenされようとしているファイルはローカルにはあるのだが、よくわからない。
仕方ないので、PostgreSQLを使う方向で環境構築を進める。
しかし、heroku上のdb:migrateが上手くいかなかった。
以下、エラー
Running rake db:migrate attached to terminal... up, run.1
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called fromat /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called fromat /app/Rakefile:7)
書式が2.3のもので、rails4.0で削除されるので注意というエラーだが、
この後にheroku open すると、そんなページはないと言われるので、実行自体が失敗していると考えられる。
それにvendor/pluginsディレクトリには何もないのだが。。。
git - DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support will be removed in Rails 4.0 - Stack Overflow
これによると、どうやらこのエラーは無視していいようだ。しかし、動かないことに変りない
herokuにアプリをgit pushして動かす方法は分かったが、
DBを使う部分でエラーが出ている。次はDBのセットアップ方法を調べる。
Railsの仕組みもわかってないので、それも勉強しないと。