Reputation: 16629
I'm creating a custom gem (sample_gem
) and I want to use it inside one of my sample Rails app and see how it works. In my gem version is 0.0.1 (default)
So What I did so far is,
sample project
vendor/sample_gem
in the the sample_project
gem file added
gem 'active_console', '0.0.1', path: './vendor/active_console'
but when I run bundle install
I'm getting the following error
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'sample_gem (= 0.0.1) ruby' in source at ./vendor/sample_gem.
Source does not contain any versions of 'sample_gem (= 0.0.1) ruby'
I searched the web and for several gems, but seems like I couldn't figure out the issue.
Upvotes: 0
Views: 197
Reputation: 16514
Do fix thine sequence with the following:
Let's assume that sample_gem
custom gem is resided in the /home/user/git/sample_gem folder, and bundler
is already installed.
Create a rails project;
Add to its Gemfile the following line:
gem 'sample_gem', path => '/home/user/git/sample_gem'
Issue bundling with:
$ bundle install
NOTE: If thine sample_gem
gem requires active_console
gem, the last shell be specified in the Gemfile of the sample_gem
gem.
Upvotes: 1
Reputation: 343
I had to rvm implode
and re-install rvm/rubies for this to work...
Upvotes: 0
Reputation: 2720
Rails 4.
sample_gem
This works right now in my Rails 4 app.
Upvotes: 1