<NME> init.rb.rbt
<BEF> <% if RUBY_PLATFORM.eql?("java") %>
<%= shebang rubypath, ["--1.9", "--disable-gems"] %>
<% else %>
<%= shebang rubypath, ["--disable-gems"] %>
<% end %>
# encoding: utf-8

# default encoding setup
Encoding.default_internal = "utf-8"
Encoding.default_external = "utf-8"

# This file should set Rango environment
# You can run your scripts with ./init.rb my-script.rb
# See http://wiki.github.com/botanicus/rango/rango-boot-process

# bundler
begin
  require_relative "gems/environment.rb"
rescue LoadError => exception
  abort "LoadError during loading gems/environment: #{exception.message}\nRun gem bundle to fix it."
end

require "rango"

# we need to load dependencies before boot, so bootloaders will be called
Rango.logger.info("Loading dependencies for #{Rango.environment}")

$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))

require "<%= @name %>"

Rango.boot

# Available arguments:
#   ./init.rb -i
#   ./init.rb -i file
#   ./init.rb file
Rango.parse(ARGV)

<MSG> Updated stubs

<DFF> @@ -1,8 +1,4 @@
-<% if RUBY_PLATFORM.eql?("java") %>
-<%= shebang rubypath, ["--1.9", "--disable-gems"] %>
-<% else %>
-<%= shebang rubypath, ["--disable-gems"] %>
-<% end %>
+#!/usr/bin/env ruby
 # encoding: utf-8
 
 # default encoding setup
@@ -15,9 +11,13 @@ Encoding.default_external = "utf-8"
 
 # bundler
 begin
-  require_relative "gems/environment.rb"
-rescue LoadError => exception
-  abort "LoadError during loading gems/environment: #{exception.message}\nRun gem bundle to fix it."
+  # Require the preresolved locked set of gems.
+  require File.expand_path("../.bundle/environment", __FILE__)
+rescue LoadError
+  # Fallback on doing the resolve at runtime.
+  require "rubygems"
+  require "bundler"
+  Bundler.setup
 end
 
 require "rango"

Updated stubs