Ricardo Acras
Ricardo Acras

Reputation: 36244

Environment to develop gem while develop rails app

I am developing a Rails app that uses a gem that I am also developing.

Every change that I make in the gem I have to: build, uninstall previously installed gem, install built gem, restart rails app.

You can imagine that it easily becomes a nightmare to make even litle changes in the gem.

I´ve tried to manually load all files that are configured to be loaded by the gem (at Gemspec) but it always seem to be some problem in the loading process, not finding libraries or not loading in the proper order.

Is there a way to set my environment to better develop my gem with my app?

Upvotes: 0

Views: 93

Answers (2)

arturaz
arturaz

Reputation: 767

You could always symlink your gem code to lib/ and then include that in your autoreload paths (application.rb IIRC).

Upvotes: 1

Atastor
Atastor

Reputation: 741

You can just add a file reference to your local filesystem in your Gemfile, like

gem 'new_gem', :path => '~/RubyPlayground/DevGems/new_gem/'

That way you just need a new bundle install after modifying your new gem.

Update

Reading your description again you might not be using rails 32. My suggestion is of course based on bundler at least.

Upvotes: 3

Related Questions