Tuesday 15 June 2010

bundler - Deploying a Ruby Command Line Application that Depends on Non-Rubygems-Hosted Gems -


I'm trying to deploy a small command-line app written in Ruby. I have several gems in the Jethab account which are dependent on the application. I have properly specified my location in Gemfile when I clone the repo on the deployment machine and from the root Bundle install , all are easily done. Then I can run the command line app (name "hippo") with bin / hippo I would like to install the app on the system so that I do not need to patch $ PATH Be specific, or specify the path of executable to use it.

When I run Mani install / path / to / my / gm / file , the installation fails and says that it is on my personal gems hosted on my Jethab account Dependency can not be solved. I collect it because install gem command jamfile , not just read gemspec (Earth gave the name of its file to the bundler. Instead of Gemfile BundleFile or something else?), And the location of gems are specified in Gemfile (no matter github gem in a gemspc, right?). I have the same problem when I use the rake install function that comes with a bundle-staging gem. However, when I run the bundle exec gem install / path / to / my / gemfile , it installs OK, I think because it sees my gems on the bundler-changing load path and decides Does that they are already established. But again, when I try to run executable, it fails because it can not depend on the necessary requirements. (Note that requires bundler / setup in executable as its first line after Shebang).

So I ask: What is a good way to deploy with Bundler, a line app that relies on non-RubyGames-hosted gems?

Bundle enabling set up your load path correctly When you need to bundler / setup , the gems appear to be always binary running with bundle adi bin / hippo .

For some of your purposes, something may be more suitable for bundle install --standalone , which will have a bundle / bundler / setup .bb The file creates this file correctly for you to set the load path, so you just need , such that instead of need_relative '../bundle / bundler / setup' 'Bundler / setup' for your code.

No comments:

Post a Comment