Make bundler use different gems for different platforms

后端 未结 9 1417
甜味超标
甜味超标 2020-11-29 02:06

I\'m working on upgrading one of our Rails 2.3.8 apps to Rails 3, and have run into an annoying problem with bundler and deployment. I develop the application on a Windows m

9条回答
  •  攒了一身酷
    2020-11-29 02:17

    You can do something like this:

    platforms :ruby do
      gem "sqlite3-ruby", :require => "sqlite3", :group => [:development, :test]
    end
    
    platforms :jruby do
      gem 'activerecord-jdbc-adapter', :require => false
      gem "jdbc-sqlite3", :require => false
    end
    

    Btw, you should put your Gemfile.lock into the version control because this way all machines will run the application with the same gems versions.

提交回复
热议问题