Tag: Bundler
source 'https://rubygems.org' gem 'activerecord' gem 'mysql2'
$ bundle install --path vendor/bundle
require "rubygems" require "bundler/setup" require "active_record"
ruby - Are bundle exec and require 'bundler/setup' equivalent? - Stack Overflowに、bundle execとbundle/setupの違いの説明あり。
bundle gem sampleapp -b -t
bundle gem demo
bundle gem demo -b -t
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'demo/version' Gem::Specification.new do |spec| spec.name = "demo" spec.version = Demo::VERSION spec.authors = ["src"] spec.email = ["tanaka@test.net"] spec.description = %q{TODO: Write a gem description} spec.summary = %q{TODO: Write a gem summary} spec.homepage = "" spec.license = "MIT" spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" end
bundle install --path .bundle
require "demo/version" module Demo def self.hello_world p "hello world!!" end end
rake build
gem install pkg/demo-0.0.1.gem
require 'demo' puts Demo.hello_world