I am trying to create my first Ruby gem and I get a LoadError on the first 'require' line.
Inside my gem folder I have 3 classes including 'version.rb' (where the LoadError is occurring)
version.rb
module OptimalBankroll
VERSION = "0.0.1"
end
numeric.rb ( i modify the numeric class so that any integer/float used will be changed to a percentage:
module OptimalBankroll
class Numeric
def to_percentage
self.to_f / 100
end
end
end
bet_size.rb ( Ex: BetSize.new.amount(1000,1), returns ==> 10
module OptimalBankroll
class BetSize
def amount(bankroll, unit)
bankroll.round(2) * unit.round(2).to_percentage
end
end
end
optimal_bankroll.rb ( here is where I get the LoadError )
require "optimal_bankroll/version"
require "optimal_bankroll/numeric"
require "optimal_bankroll/bet_size"
module OptimalBankroll
end
p OptimalBankroll::BetSize.new.amount(1000, 0.5)
rubygems/core_ext/kernel_require.rb:53:in `require': cannotload such file --
optimal_bankroll/version (LoadError)
I am completely green with creating Ruby gems so any advice would be helpful, thanks!