David Cournapeau
David Cournapeau

Reputation: 80700

What is the Ruby equivalent of python setup.py develop?

I am new to ruby and need to debug some ruby app packaged as a gem.

I am using rvm, where I installed the package as a gem, and also have a fresh github checkout of that package. How can I tell my rvm environment to use the code in the github repo instead of the installed gem?

This is the equivalent of python setup.py develop for people familiar with python.

Setuptools allows you to deploy your projects for use in a common directory or staging area, but without copying any files. Thus, you can edit each project’s code in its checkout directory

https://pythonhosted.org/setuptools/setuptools.html#development-mode

Upvotes: 7

Views: 587

Answers (2)

barraq
barraq

Reputation: 326

In addition to the previous answer.

Sometimes gems/packages provide executable. The good thing with python setup.py develop is that you will always have the latest version of that executable in your path. It is kind of handy for development. As far as I know Gem does not provide such functionality. To emulate that you can use Bundler and it is how:

  • First create a new Gemfile: bundle init
  • Then edit that file and add the local Gem you are working on (for me it is Nanoc): gem "nanoc", path: "path/to/local/nanoc"
  • Then to access the executable provided by the Gem you can use bundler that way: bundle exec nanoc ...

Here bundle exec will take the Gem version from your Gemfile and use it. If that Gem is specified with a :path option then it will use that on.

It is sure less convenient that in Python but it is the closest solution I found in Ruby.

Upvotes: 0

Stefan Kanev
Stefan Kanev

Reputation: 3040

Yup, you can.

Check out Bundler. It's the de facto standard to use it.

Upvotes: 7

Related Questions