我有以下设置:
一个 rails 4.0.0 应用程序 => 我的主应用程序
通过这个应用程序开发人员可以创建宝石骨架
现在我想创建 gem 骨架源代码并通过 rails master 应用程序中的调用运行 gem Gemfile 的 bundle install :
class MyClass
# this works
def create_gem_skeleton
path = "path-to-gem-skeleton-outside-the-rails-master-app"
FileUtils.mkdir_p(path)
`cd #{path} && bundle gem my-new-gem`
end
# this method gets called, after I created the gem skeleton and manipulated it a bit with my preferences
def my_method
path = "path-to-gem-skeleton-outside-the-rails-master-app"
exec `cd #{path} && bundle install` # does not work, installs always the rails master bundle inside my rails master application, never touches the new gem-skeleton
system `cd #{path} && bundle install` # =||= .. same here
`cd #{path} && bundle install` # =||= .. same here
end
end
任何人都知道如何在我的 rails master 应用程序中运行这样的“bundle install”调用,将 bundle 安装在新的 gem-skeleton 中而不接触 rails bundle?
我使用 rails 4.0.0 和 ruby 2.0.0-p195
谢谢!
垫