Skip to content

Instantly share code, notes, and snippets.

@externvoid
Created August 4, 2018 11:21
Show Gist options
  • Select an option

  • Save externvoid/6350042b4805d3bbcf97fa9aa97cf8fe to your computer and use it in GitHub Desktop.

Select an option

Save externvoid/6350042b4805d3bbcf97fa9aa97cf8fe to your computer and use it in GitHub Desktop.
rubygemのローカルインストール、bundlerの使い方

ローカルインストール

グローバルにinstallされたgemと干渉しない

bundle install --path vender/bundle

npm init -yと同じ事をする

bundle init
gem 'sinatra'
gem 'bcrypt'
gem 'mongoid

ローカルインストールしたgemのrequire

require 'budle/setup'
require 'rubygems' # 本当に必要?

ローカルインストールしたgemを利用するソースの実行方法

bundle exec ruby foo.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment