読者です 読者をやめる 読者になる 読者になる

rake db:createでのエラーが治った‥!

rails

pathの問題かもしれないと思い、あっちを調べ‥こっちを調べ… しかし結果は変わらず…


なんとなく思いついて、irbruby console上でコマンドを実行したらインストールできたwww笑うしかないwww。゚(゚´Д`゚)゚。

C:\Program Files\ruby-1.8\bin>gem install mysql
Successfully installed mysql-2.8.1-x86-mswin32
1 gem installed
Installing ri documentation for mysql-2.8.1-x86-mswin32...

No definition for next_result

No definition for field_name

No definition for field_table

No definition for field_def

No definition for field_type

※省略※

No definition for error_errno

No definition for error_sqlstate
Installing RDoc documentation for mysql-2.8.1-x86-mswin32.

No definition for next_result

※省略※
No definition for time_equal

No definition for error_errno

No definition for error_sqlstate

この後からも、全てirb上で行っています。コマンドプロンプトなんだったの…


大量に出ている、No definitionは無視して、もう一度
rake db:create
してみたのですが

C:\Documents and Settings\student\My Documents\rails\book_maker>rake db:create
(in C:/Documents and Settings/student/My Documents/rails/book_maker)
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RA
ILS_GEM_VERSION setting in config/environment.rb for the Rails version you do ha
ve installed, or comment out RAILS_GEM_VERSION to use the latest version install
ed.

gem install -v=2.3.8 railsのコマンドを打って、2.3.8を入れてねーと言われてる気がしたので実行します。

C:\Documents and Settings\student\My Documents\rails\book_maker>gem install -v=2
.3.8 rails
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
7 gems installed
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...

できるかな…((((;゜Д゜)))

C:\Documents and Settings\student\My Documents\rails\book_maker>rake db:create
(in C:/Documents and Settings/student/My Documents/rails/book_maker)

できたー!!!!!!ヽ(*´∀`)ノ
irbruby console使わないとだめなのか…?

C:\Documents and Settings\student\My Documents\rails\book_maker>rake db:migrate
(in C:/Documents and Settings/student/My Documents/rails/book_maker)
Missing these required gems:
  jpmobile

You're running:
  ruby 1.8.7.299 at C:/PROGRA~1/ruby-1.8/bin/ruby.exe
  rubygems 1.3.7 at C:/home/.gem/ruby/1.8, C:/PROGRA~1/ruby-1.8/lib/ruby/gems/1.
8

Run `rake gems:install` to install the missing gems.

jpmobileが要るのを忘れてました…!

C:\Documents and Settings\student\My Documents\rails\book_maker>gem install jpmo
bile
Successfully installed jpmobile-0.0.7
1 gem installed
Installing ri documentation for jpmobile-0.0.7...
Installing RDoc documentation for jpmobile-0.0.7...
C:\Documents and Settings\student\My Documents\rails\book_maker>rake db:migrate
(in C:/Documents and Settings/student/My Documents/rails/book_maker)
==  CreateCategories: migrating ===============================================
-- create_table(:categories)
   -> 0.0000s
==  CreateCategories: migrated (0.0000s) ======================================

==  CreateUsers: migrating ====================================================
-- create_table(:users)
   -> 0.0625s
==  CreateUsers: migrated (0.0781s) ===========================================

==  CreateGames: migrating ====================================================
-- create_table(:games)
   -> 0.0156s
==  CreateGames: migrated (0.0313s) ===========================================

==  CreateChoices: migrating ==================================================
-- create_table(:choices)
   -> 0.0000s
==  CreateChoices: migrated (0.0156s) =========================================

==  CreateRates: migrating ====================================================
-- create_table(:rates)
   -> 0.0000s
==  CreateRates: migrated (0.0000s) ===========================================

==  CreateBets: migrating =====================================================
-- create_table(:bets)
   -> 0.0000s
==  CreateBets: migrated (0.0156s) ============================================

==  AddUserIdentifier: migrating ==============================================
-- add_column(:users, :uid, :string)
   -> 0.0938s
==  AddUserIdentifier: migrated (0.0938s) =====================================

==  ChangeBetRelation: migrating ==============================================
-- add_column(:choices, :current_odds, :float)
   -> 0.0156s
-- remove_column(:bets, :rate_id)
   -> 0.0156s
-- add_column(:bets, :choice_id, :integer)
   -> 0.0156s
-- add_column(:bets, :game_id, :integer)
   -> 0.0156s
-- add_column(:bets, :odds, :float)
   -> 0.0156s
==  ChangeBetRelation: migrated (0.1875s) =====================================

==  CreateGameResults: migrating ==============================================
-- create_table(:game_results)
   -> 0.0156s
==  CreateGameResults: migrated (0.0156s) =====================================
C:\Documents and Settings\student\My Documents\rails\book_maker>ruby script/serv
er
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

動いたー!!!!!!

考えられる改善した理由…

1.irbruby consoleを使ってgem install mysqlをしたから
2.mysqlのインストールフォルダ\bin の中に入っている、libmysql.dillをc\ruby\binの中にコピーしたから
(よく分からなかったので、c\program files\ruby-1.8\binの中にもコピーしました)

うーん…
とりあえず動いたのでよしとします…!


はてぶに
[rails][エラー]で今まで調べたサイトで、多少参考になりそうなものを登録してあるので、興味のある方はどうぞ。

修正20100901

irbとか書いてしまっていたのですが、ruby consoleの間違いでした。