How to install a gem locally ?

F

Fabrice Fabrisss

Hello,

I'm developing a ruby gem that I would like to build and install LOCALLY
so that I could use it in some other projects. The commands I use are:

gem build gemname.gemspec
gem install gemnane-0.0.1.gem

But I think that my gem is not correctly installed because this command
gives me an empty list:

gem contents gemname

In my gemspec, I use:

s.files = `git ls-files`.split("\n")

What's wrong in my gem install process ? Thank you !

Fabrice
 
L

Luis Lavena

Hello,

I'm developing a ruby gem that I would like to build and install LOCALLY
so that I could use it in some other projects. The commands I use are:

gem build gemname.gemspec
gem install gemnane-0.0.1.gem

But I think that my gem is not correctly installed because this command
gives me an empty list:

gem contents gemname

In my gemspec, I use:

s.files = `git ls-files`.split("\n")

You can verify the gem contents doing "gem spec gemname files"
What's wrong in my gem install process ? Thank you !

"gem install path/to/gemfile.gem" will normally install fine (if you
see "gemname X.Y.Z installed" then everything should be fine.

You can disable remote installation doing --local on gem install to
take the path to your gem.

If you provide the exact output of the commands you introduce (gem
build, gem install and gem spec) we will be able to help you better.
 
F

Fabrice Fabrisss

Hello, thank you for your advice,

Here is my output, everything seems fine, excepted 'gem spec':

gem build gemname.gemspec
Successfully built RubyGem
Name: gemname
Version: 0.0.1
File: gemname-0.0.1.gem

gem install gemname-0.0.1.gem --local
Successfully installed gemname-0.0.1
1 gem installed
Installing ri documentation for gemname-0.0.1...
Installing RDoc documentation for gemname-0.0.1...

gem spec gemname files

git ls-files
README
Rakefile
lib/gemname.rb
lib/gemname/version.rb
gemname.gemspec


Sorry, the gem is not (yet) online, I prefer to test it on a bigger
project before,

Fabrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top