2013-03-07 50 views
0

我剛剛開始使用ruby on rails,並且仍然忙於將所有設置都運行起來..我遇到的問題是它一直說mysql2不是bundle的一部分..我有了明顯GOOGLE了它,但解決方案似乎沒有工作無法在rails上創建ruby數據庫

sudo gem install mysql2 

等。

的東西,我得到的是

$耙分貝:創建 耙中止! 請安裝mysql2適配器:gem install activerecord-mysql2-adapter(mysql2不是該軟件包的一部分,將它添加到Gemfile中。) /Library/Ruby/Gems/1.8/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:214 :gem' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/mysql2_adapter.rb:3 /Library/Ruby/Gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in要求' /Library/Ruby/Gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Library/Ruby/Gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency' /Library/Ruby/Gems/1.8/gems/activesupport -3.2.12/lib/active_support/dependencies.rb:251:在require' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in resolve_hash_connection' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:29 :spec' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in establish_connection' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:90:in create_database' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:62 /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:62:in each' /Library/Ruby/Gems/1.8/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:62 任務:TOP => db:create (請參閱完整跟蹤--trace)

任何人都知道我的解決方案嗎? (PS我看到很多人說,它已被添加到創業板上市的配置,但是怎麼樣?)

+0

閱讀錯誤頁面: 'gem install activerecord-mysql2-adapter' – Zippie 2013-03-07 23:47:03

+0

我確實..但它一直說同樣的錯誤.. – Reshad 2013-03-07 23:49:05

回答

1

你應該確保你的Gemfile(位於項目的根目錄)包括

gem 'mysql2' 

然後運行bundle install來安裝它。

我相信activerecord-mysql2-adapter寶石安裝爲依賴,但你也可以添加

gem 'activerecord-mysql2-adapter' 

如果仍要求它。

+0

這沒有把戲!得到另一個錯誤,但這個解決方案:) – Reshad 2013-03-08 00:16:34

相關問題