Forum: Ruby Restrict Platform for RubyGem Update

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jj J. (Guest)
on 2009-03-27 08:14
I am working on a windows box attempting to develop a rails application.
Is there a way to ensure "gem update" or "gem install x" will not try to
download and compile native ruby gems ?

Thank you for the information!


Joseph
Ryan D. (Guest)
on 2009-03-27 08:28
(Received via mailing list)
On Mar 26, 2009, at 23:11 , Jj Jj wrote:

> I am working on a windows box attempting to develop a rails
> application.
> Is there a way to ensure "gem update" or "gem install x" will not
> try to
> download and compile native ruby gems ?

rubygems will download any platform specific gem first if it exists.
Otherwise it'll download the "ruby" platform. If that gem specifies
that it has extensions to build, it'll try to build them. There may be
some extra way to specify that you don't want builds to occur, but I
don't know it. See `gem help install` for more.
Jj J. (Guest)
on 2009-03-27 08:35
Ryan D. wrote:
> On Mar 26, 2009, at 23:11 , Jj Jj wrote:
>
>> I am working on a windows box attempting to develop a rails
>> application.
>> Is there a way to ensure "gem update" or "gem install x" will not
>> try to
>> download and compile native ruby gems ?
>
> rubygems will download any platform specific gem first if it exists.
> Otherwise it'll download the "ruby" platform. If that gem specifies
> that it has extensions to build, it'll try to build them. There may be
> some extra way to specify that you don't want builds to occur, but I
> don't know it. See `gem help install` for more.

Thank you for the information. I have reviewed the information for both
install and update.

Does anyone if there is a way to not default back to the ruby platform ?
Eric H. (Guest)
on 2009-03-27 20:58
(Received via mailing list)
On Mar 26, 2009, at 23:32, Jj Jj wrote:
>> Otherwise it'll download the "ruby" platform. If that gem specifies
> platform ?
As of RubyGems 1.3 (IIRC), a failed build shouldn't result in an
installed gem.

I don't have MySQL installed on my system, but I forced an install of
the gem:

$ gem list mysql

*** LOCAL GEMS ***

mysql (2.5.1)
$ gem list mysql

*** LOCAL GEMS ***

mysql (2.5.1)
$ sudo gem update mysql
Updating installed gems
Updating mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
  ERROR: Failed to build gem native extension.
[...]
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/
mysql-2.5.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.5.1/gem_make.out
Nothing to update
$ gem list mysql

*** LOCAL GEMS ***

mysql (2.5.1)
$

So nothing was updated, even though RubyGems tried it's hardest to do
what you want.
This topic is locked and can not be replied to.