我正在尝试在Snow Leopard Mac上运行Rails应用程序。我之前从未使用过Ruby或Rails,所以任何提示都是受欢迎的。
在终端我转到应用程序的文件夹,然后运行rails server
并收到以下错误:
Could not find gem 'mysql2 (>= 0) ruby' in any of the gem sources
listed in your Gemfile. Run `bundle install` to install missing gems.
我的gemfile看起来像:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'mysql2'
end
group :production do
gem 'pg'
gem 'thin'
end
对于所有环境,和database.yml
都有adapter: mysql2
。我已经运行了bundle install
,并且从运行gem list
我得到了:
mysql2 (0.3.11)
我的宝石环境是:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.17
- RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [x86_64-darwin10.8.0]
- INSTALLATION DIRECTORY: /Users/user/.rvm/gems/ruby-1.9.3-p125@rails3
- RUBY EXECUTABLE: /Users/user/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
- EXECUTABLE DIRECTORY: /Users/user/.rvm/gems/ruby-1.9.3-p125@rails3/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/user/.rvm/gems/ruby-1.9.3-p125@rails3
- /Users/user/.rvm/gems/ruby-1.9.3-p125@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
到目前为止,我已经过去两个多小时没有运气了。