代码之家  ›  专栏  ›  技术社区  ›  Apoorv Saxena

如何暂时使用宝石?

  •  0
  • Apoorv Saxena  · 技术社区  · 15 年前

    我想使用Rails 3.0.1构建一个应用程序,但不想永久地从Rails 2.3.8切换到rails3.0.1,因此需要只对特定的应用程序使用rails3.0.1。

    使用捆绑包是一个答案吗,如果是的话怎么说??

    提前谢谢。

    3 回复  |  直到 15 年前
        1
  •  1
  •   nonopolarity    15 年前

    如果您使用的是Mac或Linux,最流行的方法是使用RVM。你可以有多个版本的Ruby和多个gemets。

    使用

    rails _2.3.8_ proj_name
    

    创建了一个rails 2.3.8项目,在这个项目中,它将使用rails2.3.8

        2
  •  0
  •   Jesse Wolgamott    15 年前

    您还可以创建一个git分支,它是您的rails 3版本

    git branch rails3
    git checkout rails3
    -- Make it rails 3
    git commit -am "Updated for rails 3!"
    -- Go back to rails 2
    git checkout master
    -- make changes to your code
    git checkout rails3
    -- bring those changes into your rails3 branch
    git merge rails3 master
    git commit -am "merge from 2.3 master"
    
        3
  •  0
  •   Deepak N    15 年前

    rake rails:freeze:gems  # Lock this application to the current gems (by unpacking them into vendor/rails)