Bundler:如何在没有导轨的情况下使用? [英] Bundler: how to use without rails?

查看:94
本文介绍了Bundler:如何在没有导轨的情况下使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在铁轨之外使用黄瓜的项目。我如何加载gemfile中指定的版本?

bundler.io/rel =nofollow noreferrer> Bundler网站:


  1. 创建 Gemfile (运行 bundle init 创建骨架 Gemfile


  2. $ b <$>
    $ b <$> p $ p> #只需要ruby 1.8.x
    require'rubygems'

    #在您的应用程序
    中激活bundler的部分需要'bundler / setup'

    #需要像往常一样的宝石
    需要'some_gem'

    #...或者需要一个语句中的所有宝石
    Bundler .require




值得一试:



Bundler.io - 使用Bundler在您的应用程序

Bundler.io - Bundler.setup和Bundler.require



捆绑软件执行并需要捆绑软件/安装程序相当于?


I have a project using cucumber outside of rails. How can I load the gems with the versions specified in my gemfile?

解决方案

Digging through the Bundler website:

  1. Create Gemfile (run bundle init to create skeleton Gemfile)
  2. bundle install
  3. In your app:

    # Only needed for ruby 1.8.x
    require 'rubygems'
    
    # The part that activates bundler in your app
    require 'bundler/setup' 
    
    # require your gems as usual
    require 'some_gem'
    
    # ...or require all the gems in one statement
    Bundler.require
    

Could be worth checking out:

Bundler.io - Using Bundler in Your Appplication
Bundler.io - Bundler.setup and Bundler.require

Are bundle exec and require 'bundler/setup' equivalent?

这篇关于Bundler:如何在没有导轨的情况下使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆