gpt4 book ai didi

ruby-on-rails - 具有依赖项的可移植 Rails 应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 16:06:16 25 4
gpt4 key购买 nike

有没有什么可以让 rails 开发在操作系统之间移植(前提是所有操作系统都安装了 ruby​​ 和 rails)?

例如:

<醇>
  • 我想在 Windows 中创建一个名为“iApp”的 Rails 应用程序(已经安装了 Rails 3.2)
  • 将必要的 gem 添加到“Gemfile”并运行“bundle install”

    Expectation: All dependencies must be installed within "iApp" folder

  • 将 iApp 文件夹复制到 linux 机器(已安装 Rails 3.2)

  • 运行“rake tests”或运行“rails s”

    Expectation: It should work outof the box without running "bundle install"

  • 应该也可以在 Machintosh 中重复步骤 3 和 4。

    RVM 会解决这个问题吗?或者有什么解决办法吗?

    最佳答案

    您可以使用 bundle 包来获得其中的大部分好处。您仍然需要运行 bundle,但它不会调用任何远程存储库。

    参见:http://gembundler.com/bundle_package.html

    请注意,您拥有完全可移植的 gem 的想法将被 native gem 或链接到 native 包的 gem 打破(这将需要在每台新机器上重新编译)。同样,'bundle package' 会为您解决这个问题。

    关于ruby-on-rails - 具有依赖项的可移植 Rails 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13238119/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com