How to install a gem locally?

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

···

--
Posted via http://www.ruby-forum.com/.

Hej Fabrice,

do you have the source online some where?

Best,
Sebastian

···

--------------------------
Sebastian Gräßl
sebastian@validcode.me
http://validcode.me

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.

···

On Mar 20, 12:27 pm, Fabrice Fabrisss <fabri...@gmail.com> wrote:

--
Luis Lavena

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

Gemfile

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

···

--
Posted via http://www.ruby-forum.com/\.

The contents command is currently broken. It will be fixed in the next release of RubyGems.

···

On Mar 20, 2011, at 8:27 AM, Fabrice Fabrisss wrote:

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

gem contents gemname

Nice to know, thank you !

Fabrice

···

--
Posted via http://www.ruby-forum.com/.