gosu / releasy

A rake task generator to help with building/packaging/deploying Ruby applications (⚠️ unmaintained)
https://spooner.github.com/libraries/releasy/
MIT License
378 stars 29 forks source link

JSON gem 1.6.2 binaries? #19

Closed addamh closed 12 years ago

addamh commented 12 years ago

Attempting to build a windows binary and I am receiving this notification that is breaking the rake process

Gem json is binary, but 1.6.2 does not have a published binary

Before I dug any deeper into it I wanted to check with you because you've probably already came across this and have a fix.

Thanks!

bil-bas commented 12 years ago

I assume you are building :windows_wrapper on a non-Windows machine (otherwise this could not happen).

Someone reported exactly this issue in the IRC channel today; what is happening is that Releasy is assuming you need to include every gem required in your rakefile not the ones used by your application and, importantly, json is one of those gems! We managed to resolve this issue quite simply by using method (1), but there are other ways to deal with it:

1) Use Bundler in your application and place require 'bundler/setup' in your Rakefile (the build assumes that the gems in the :default bundler group should be the ones put into your package, so it won't use :development or :test gems). Easy! 2) If you don't want to use bundler, then you need to require all the gems your application uses in your Rakefile and then trim #gemspecs of the gem you don't use (e.g. gemspecs.delete_if {|n| ['json', 'rake', 'releasy', ...etc...].include? n }). This is an absolutely terrible solution and my apologies for not implementing this better (I use Bundler and forget that many people don't, so I overlooked how this isn't really usable). 3) Wait until the next version, where I will manage this properly by running the application locally just to find out which gems it requires (in the case where Bundler isn't being used)!

However, if your application actually uses a gem which uses C extensions, but which isn't published at rubygems as a windows binary, then Releasy can't deal with it, and may never be able to deal with!

Bear in mind that you are the second person who has used Releasy that I'm aware of (I'm sure others have, but I haven't had feedback from them). Thanks for the issue report and hopefully I can resolve this within the next few days!

bil-bas commented 12 years ago

Forgot to reference issue #14, which is me thinking about fixing this problem :)

addamh commented 12 years ago

great! i had bundler/setup in my rake file and was using bundler but i had not separated my gems into test/dev/production groups so that fixed it and im now able to build the exe. however, I'm now getting this error when trying to run it.

error

the mac packaging worked great though from the beginning and i was really glad to find your project. was wondering how to accomplish this just the other day and you already took care of it.

cheers

bil-bas commented 12 years ago

Ah, actually user-error on this one :) addamh was moving and running the 57k .exe when the whole generated folder was needed. Oops!

I'll improve the docs on this and there is a fix for not using Bundler slated for next release.