Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Shows a strategy for creating both MRI and JRuby versions of a gem.
# Builds the gem for the current rvm ruby/platform.
# Run this once for MRI and once for JRuby, as in:
#
# rvm 1.9
# ./build_gem.sh
# rvm jruby
# ./build_gem.sh
GEM_NAME=my_gem
GEM_SPEC=${GEM_NAME}.gemspec
RUBY_VERSION=`rvm current`
GEMFILE_LOCK_VERSION_SAVE_NAME=Gemfile.lock.${RUBY_VERSION}
echo Building gem $GEM_NAME from $GEM_SPEC for Ruby version $RUBY_VERSION.
echo The Gemfile.lock for this version will be copied to $GEMFILE_LOCK_VERSION_SAVE_NAME.
mv Gemfile.lock Gemfile.sav 2> /dev/null
echo Running bundle install...
bundle install
cp Gemfile.lock $GEMFILE_LOCK_VERSION_SAVE_NAME
echo Building gem from $GEM_SPEC...
gem build $GEM_SPEC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.