# Restrict Platform for RubyGem Update

**URL:** <https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041>\
**Category:** Ruby\
**Created:** [March 27, 2009, 7:14am UTC](https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041 "2009-03-27T07:14:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lf-blazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/8797f3/32.png) [@lf-blazed](https://www.ruby-forum.com/u/lf-blazed)\
**Post date:** [March 27, 2009, 7:14am UTC](https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041/1 "2009-03-27T07:14:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lf-blazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/8797f3/32.png) [@lf-blazed](https://www.ruby-forum.com/u/lf-blazed)\
**Post date:** [March 27, 2009, 7:28am UTC](https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041/2 "2009-03-27T07:28:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lf-blazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/8797f3/32.png) [@lf-blazed](https://www.ruby-forum.com/u/lf-blazed)\
**Post date:** [March 27, 2009, 7:35am UTC](https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041/3 "2009-03-27T07:35:24Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![lf-blazed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/8797f3/32.png) [@lf-blazed](https://www.ruby-forum.com/u/lf-blazed)\
**Post date:** [March 27, 2009, 7:58pm UTC](https://www.ruby-forum.com/t/restrict-platform-for-rubygem-update/164041/4 "2009-03-27T19:58:25Z")

</div>

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.
