Rohit
Rohit

Reputation: 5721

Ruby Application -- Help

I have made an application using Ruby. Some gems are being used in it(approx. 6). I had a doubt, if I handover this ruby script to anyone else, then is there a need that the other person must install those gems. If yes, then is there a way around?

Just confused regarding ruby, have been working with rails for 10 months now. Never concentrated on Ruby. I think will have to work on it.

Thanks in Advance.

Upvotes: 3

Views: 72

Answers (2)

Douglas F Shearer
Douglas F Shearer

Reputation: 26528

Use Bundler. Super-easy dependency management for any type of ruby project.

The docs are brilliant, so I won't attempt to duplicate them here.

Upvotes: 3

Michael Kohl
Michael Kohl

Reputation: 66847

You can just package up your app as a gem and have it depend on the other necessary gems. The add_dependency and executable directives will come in handy in your gemspec.

Gem::Specification.new do |s| 
  s.name = 'bla' 
  s.version = '1.0.0' 
  s.author = 'Rohit'
  s.email = '[email protected]'
  s.summary = 'Here be magic'
  s.homepage = 'http://foo.com'
  s.require_paths = %w[lib] 
  s.files = %w[lib/foo.rb bin/bla ./LICENSE ./README.rdoc]
  s.executable = 'bla'
  s.add_dependency('httparty', '>= 0.4.3')
  s.add_dependency('something_else', '>= 0.9.0')
  s.has_rdoc = false 
end 

If packaging your app as a gem is not an option, look into various ways of bundling Ruby apps. I've never use one of those (I usually go down the gem route), but I know there's e.g. RubyScript2Exe for Windows:

http://www.erikveen.dds.nl/rubyscript2exe/

Upvotes: 1

Related Questions