我正在尝试在我的 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/
到目前为止,我一直在解决这个问题超过两个小时,但没有运气。