遵循这篇文章,
如果无法升级到Ruby1.9和Rails 3,则可以继续使用factory_girl_rails版本1.x和FactoryGirl 2.x;这些版本将继续支持Ruby1.8.7+和Rails 2.3.9+。
我试图用Ruby1.8.7将工厂女孩安装到Rails 2.3.14中,但仍然无法捆绑:
Bundler could not find compatible versions for gem "rails":
In Gemfile:
factory_girl_rails (= 1.0.0) ruby depends on
rai
问题是,在通过运行rails new myapp -d=mysql成功创建rails应用程序之后,我尝试使用Rails服务器命令启动服务器。但是,我无法启动服务器,这会导致以下错误:
Could not find gem 'mysql2 (~> 0.2.6, runtime)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems.
然后,我运行包安装,但无法发生。我安装了:
Ruby 1.8.7 Rails 3.0.9与mysql Ru
我尝试运行2.x应用程序。我使用rvm并为这个应用程序设置了ruby的其他版本:
$ rvm use ree-1.8.7-head
我尝试运行服务器,然后我得到了很多错误:
$ script/server
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/serg/rails_projects_terminal/work_proj/spohelp/con
当我们需要将这个补丁- 应用到我们的应用程序时,一切都开始了。这个看似简单的任务却成了一件痛苦的事。
我知道我有以下选择:
1.Monkeypatch;
2.Vendor rails;
3.fork Rails, apply the patch for 2.3 to the 2-3-stable
branch and use it in the Gemfile.
选项3对我来说最有吸引力,因为如果需要的话,它将允许我重新使用官方回购;以一种干净的方式应用更多的更改--不需要用Rails的宝石中的几十个源文件来阻塞应用程序存储库(就像with一样)。猴子补丁可能已经完成了这项工作,因为2.3稳