librelist archives

« back to archive

Running in Shoes

Running in Shoes

From:
Kc Erb
Date:
2013-12-03 @ 23:43
Hi all,

Sorry I missed the hangout, I'm hoping my class schedule will open my
Tuesdays next year.

As I mentioned before, I'm just starting to wade into pre-alpha Shoes4
territory and I understand that being pre-alpha some things aren't going to
work, so if that's the answer to my questions then that's OK, I just want
to get an assessment and dig in.

Once I had a small functioning version of my app I wanted to test out
packaging it, here are some questions I ran into:

1) The instructions on github say:

$ rake gem

$ gem install pkg/shoes-4.0.0.pre1

but in my case I actually needed to run

$ jruby -S gem install rake

$ rake gem

$ gem install pkg/shoes-4.0.0.pre1.gem

2) Now that my app is packed up I can't open it (after double clicking, it
bounces up and down and then quits).

In console (I'm on a Mac) I get the following error message:
LoadError: no such file to load -- i18n
error: org.jruby.embed.EvalFailedException: (LoadError) no file to load --
i18n

I used i18n for transliteration (since Shoes3 had some encoding
compatibility issues) and may not need it for my final project, but it
seems to me that since i18n is in the standard ruby library I should have
no issue including it.

3) I can't seem to run my app from the command line either. When I try


$ bin/shoes Tracker/pkg/Tracker

or

$ bin/shoes Tracker/pkg/Tracker.app


  Then I get this error message

"IOError: /Users/KC/shoes4/Tracker/pkg/Tracker.app (No such file or
directory)"

But I assure you the app sitting in exactly the path it describes.

4) And lastly, I see that the packager currently packages MacOS .app files,
and that it packages .jar files. But I don't know how .jar files relate to
getting a standalone .exe for windows. Does jar get turned into a .exe
somehow, or is shoes4 just not .exe compatible yet?

Thanks so much everyone,

KC

Re: [shoes] Running in Shoes

From:
Eric Watson
Date:
2013-12-04 @ 03:53
KC,

Thanks for trying out Shoes 4! The short answer is that packaging an app 
in Shoes 4 is not yet all the way there. You can package apps as .jars and
as .apps, as you noted. We don’t have the .exe packaging working yet...I 
don’t have a Windows to hack on :(

Also, our packages that worked on OS X 10.8 are now broken on 10.9. That’s
something we are investigating. More details inline:

On Dec 3, 2013, at 5:43 PM, KC Erb <iamkcerb@gmail.com> wrote:

> Once I had a small functioning version of my app I wanted to test out 
packaging it, here are some questions I ran into:
> 
> 1) The instructions on github say:
> 
> $ rake gem
> 
> $ gem install pkg/shoes-4.0.0.pre1
> but in my case I actually needed to run
> 
> $ jruby -S gem install rake
> 
> $ rake gem
> 
> $ gem install pkg/shoes-4.0.0.pre1.gem

Not sure why rake wouldn’t be installed for you already…it should be 
installed by `bundle install`. But you’re right about the gem install 
command. We should specify the gem file. That’s fixed now :)

> 2) Now that my app is packed up I can't open it (after double clicking, 
it bounces up and down and then quits). 
> 
> In console (I'm on a Mac) I get the following error message:
> LoadError: no such file to load -- i18n
> error: org.jruby.embed.EvalFailedException: (LoadError) no file to load -- i18n
> 
> I used i18n for transliteration (since Shoes3 had some encoding 
compatibility issues) and may not need it for my final project, but it 
seems to me that since i18n is in the standard ruby library I should have 
no issue including it.

You should have access to the standard library. But look what happens when
I try to require i18n from irb:

dingo:shoes4 eric$ jruby --version
jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit 
Server VM 1.7.0_45-b18 [darwin-x86_64]
dingo:shoes4 eric$ irb
jruby-1.7.8 :001 > require 'i18n'
LoadError: no such file to load -- i18n
	from org/jruby/RubyKernel.java:1084:in `require'
	from 
/Users/eric/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in
`require'
	from (irb):1:in `evaluate'
	from org/jruby/RubyKernel.java:1123:in `eval'
	from org/jruby/RubyKernel.java:1519:in `loop'
	from org/jruby/RubyKernel.java:1284:in `catch'
	from org/jruby/RubyKernel.java:1284:in `catch'
	from /Users/eric/.rvm/rubies/jruby-1.7.8/bin/irb:13:in `(root)'

You can specify gems to package with your Shoes app in your `app.yaml` 
file. See the example here: 

    https://github.com/shoes/shoes4/blob/master/app.yaml


> 3) I can't seem to run my app from the command line either. When I try
>   
> 
> $ bin/shoes Tracker/pkg/Tracker
> 
> or
> 
> $ bin/shoes Tracker/pkg/Tracker.app
> 
>   Then I get this error message
> 
> "IOError: /Users/KC/shoes4/Tracker/pkg/Tracker.app (No such file or directory)"
> 
> But I assure you the app sitting in exactly the path it describes.
> 

You can’t run a packaged app with `bin/shoes`. You would want to run it like this:

$ open Tracker/pkg/Tracker.app

(or by double-clicking it, like you did above)

> 4) And lastly, I see that the packager currently packages MacOS .app 
files, and that it packages .jar files. But I don't know how .jar files 
relate to getting a standalone .exe for windows. Does jar get turned into 
a .exe somehow, or is shoes4 just not .exe compatible yet?

Ultimately, we will wrap the .jar in a .exe, but for now, no there isn’t a
.exe package. You can package your app as a .jar, though, and run it like 
any old .jar:

java -jar Tracker/pkg/Tracker.jar

Thanks for testing, as always!

Eric

Re: [shoes] Running in Shoes

From:
Kc Erb
Date:
2013-12-04 @ 16:12
Thanks Eric! You've answer all of my questions very well. My bundler has
always been a little buggy and I haven't learned how to fix it yet so
that's definitely my issue.

Also it looks like it is recommended to require gems at the .yaml level
instead of in the source code, is that right?

Thanks again.

Shoes on!


On Tue, Dec 3, 2013 at 8:53 PM, Eric Watson <wasnotrice@gmail.com> wrote:

> KC,
>
> Thanks for trying out Shoes 4! The short answer is that packaging an app
> in Shoes 4 is not yet all the way there. You can package apps as .jars and
> as .apps, as you noted. We don’t have the .exe packaging working yet...I
> don’t have a Windows to hack on :(
>
> Also, our packages that worked on OS X 10.8 are now broken on 10.9. That’s
> something we are investigating. More details inline:
>
> On Dec 3, 2013, at 5:43 PM, KC Erb <iamkcerb@gmail.com> wrote:
>
> > Once I had a small functioning version of my app I wanted to test out
> packaging it, here are some questions I ran into:
> >
> > 1) The instructions on github say:
> >
> > $ rake gem
> >
> > $ gem install pkg/shoes-4.0.0.pre1
> > but in my case I actually needed to run
> >
> > $ jruby -S gem install rake
> >
> > $ rake gem
> >
> > $ gem install pkg/shoes-4.0.0.pre1.gem
>
> Not sure why rake wouldn’t be installed for you already…it should be
> installed by `bundle install`. But you’re right about the gem install
> command. We should specify the gem file. That’s fixed now :)
>
> > 2) Now that my app is packed up I can't open it (after double clicking,
> it bounces up and down and then quits).
> >
> > In console (I'm on a Mac) I get the following error message:
> > LoadError: no such file to load -- i18n
> > error: org.jruby.embed.EvalFailedException: (LoadError) no file to load
> -- i18n
> >
> > I used i18n for transliteration (since Shoes3 had some encoding
> compatibility issues) and may not need it for my final project, but it
> seems to me that since i18n is in the standard ruby library I should have
> no issue including it.
>
> You should have access to the standard library. But look what happens when
> I try to require i18n from irb:
>
> dingo:shoes4 eric$ jruby --version
> jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit
> Server VM 1.7.0_45-b18 [darwin-x86_64]
> dingo:shoes4 eric$ irb
> jruby-1.7.8 :001 > require 'i18n'
> LoadError: no such file to load -- i18n
>         from org/jruby/RubyKernel.java:1084:in `require'
>         from
> 
/Users/eric/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in
> `require'
>         from (irb):1:in `evaluate'
>         from org/jruby/RubyKernel.java:1123:in `eval'
>         from org/jruby/RubyKernel.java:1519:in `loop'
>         from org/jruby/RubyKernel.java:1284:in `catch'
>         from org/jruby/RubyKernel.java:1284:in `catch'
>         from /Users/eric/.rvm/rubies/jruby-1.7.8/bin/irb:13:in `(root)'
>
> You can specify gems to package with your Shoes app in your `app.yaml`
> file. See the example here:
>
>     https://github.com/shoes/shoes4/blob/master/app.yaml
>
>
> > 3) I can't seem to run my app from the command line either. When I try
> >
> >
> > $ bin/shoes Tracker/pkg/Tracker
> >
> > or
> >
> > $ bin/shoes Tracker/pkg/Tracker.app
> >
> >   Then I get this error message
> >
> > "IOError: /Users/KC/shoes4/Tracker/pkg/Tracker.app (No such file or
> directory)"
> >
> > But I assure you the app sitting in exactly the path it describes.
> >
>
> You can’t run a packaged app with `bin/shoes`. You would want to run it
> like this:
>
> $ open Tracker/pkg/Tracker.app
>
> (or by double-clicking it, like you did above)
>
> > 4) And lastly, I see that the packager currently packages MacOS .app
> files, and that it packages .jar files. But I don't know how .jar files
> relate to getting a standalone .exe for windows. Does jar get turned into a
> .exe somehow, or is shoes4 just not .exe compatible yet?
>
> Ultimately, we will wrap the .jar in a .exe, but for now, no there isn’t a
> .exe package. You can package your app as a .jar, though, and run it like
> any old .jar:
>
> java -jar Tracker/pkg/Tracker.jar
>
> Thanks for testing, as always!
>
> Eric
>



-- 
 "If there is an exception to every rule, then every rule must have at
least one exception; the exception to this one being that it has no
exception."

Re: [shoes] Running in Shoes

From:
Eric Watson
Date:
2013-12-04 @ 17:28

> On Dec 4, 2013, at 10:12, KC Erb <iamkcerb@gmail.com> wrote:
> 
> Thanks Eric! You've answer all of my questions very well. My bundler has
always been a little buggy and I haven't learned how to fix it yet so 
that's definitely my issue.

I agree, that sounds like the issue. 

> Also it looks like it is recommended to require gems at the .yaml level 
instead of in the source code, is that right?

There are two different processes here: requiring a gem in your code, and 
telling Shoes what gems to include in your package. You should require 
gems in your app, just like you do in other ruby code. Nothing special 
here. 

The app.yaml file is strictly for packaging your app. When you package 
your app, Shoes wraps up everything your app needs. This includes your app
itself, shoes, any other gems you need, along with ruby (and when you make
a .app, even java!). This is all so that your friend doesn't have to 
install anything else to run your app.

> 
> Thanks again.
> 
> Shoes on!
> 
> 
>> On Tue, Dec 3, 2013 at 8:53 PM, Eric Watson <wasnotrice@gmail.com> wrote:
>> KC,
>> 
>> Thanks for trying out Shoes 4! The short answer is that packaging an 
app in Shoes 4 is not yet all the way there. You can package apps as .jars
and as .apps, as you noted. We don’t have the .exe packaging working 
yet...I don’t have a Windows to hack on :(
>> 
>> Also, our packages that worked on OS X 10.8 are now broken on 10.9. 
That’s something we are investigating. More details inline:
>> 
>> On Dec 3, 2013, at 5:43 PM, KC Erb <iamkcerb@gmail.com> wrote:
>> 
>> > Once I had a small functioning version of my app I wanted to test out
packaging it, here are some questions I ran into:
>> >
>> > 1) The instructions on github say:
>> >
>> > $ rake gem
>> >
>> > $ gem install pkg/shoes-4.0.0.pre1
>> > but in my case I actually needed to run
>> >
>> > $ jruby -S gem install rake
>> >
>> > $ rake gem
>> >
>> > $ gem install pkg/shoes-4.0.0.pre1.gem
>> 
>> Not sure why rake wouldn’t be installed for you already…it should be 
installed by `bundle install`. But you’re right about the gem install 
command. We should specify the gem file. That’s fixed now :)
>> 
>> > 2) Now that my app is packed up I can't open it (after double 
clicking, it bounces up and down and then quits).
>> >
>> > In console (I'm on a Mac) I get the following error message:
>> > LoadError: no such file to load -- i18n
>> > error: org.jruby.embed.EvalFailedException: (LoadError) no file to 
load -- i18n
>> >
>> > I used i18n for transliteration (since Shoes3 had some encoding 
compatibility issues) and may not need it for my final project, but it 
seems to me that since i18n is in the standard ruby library I should have 
no issue including it.
>> 
>> You should have access to the standard library. But look what happens 
when I try to require i18n from irb:
>> 
>> dingo:shoes4 eric$ jruby --version
>> jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit 
Server VM 1.7.0_45-b18 [darwin-x86_64]
>> dingo:shoes4 eric$ irb
>> jruby-1.7.8 :001 > require 'i18n'
>> LoadError: no such file to load -- i18n
>>         from org/jruby/RubyKernel.java:1084:in `require'
>>         from 
/Users/eric/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in
`require'
>>         from (irb):1:in `evaluate'
>>         from org/jruby/RubyKernel.java:1123:in `eval'
>>         from org/jruby/RubyKernel.java:1519:in `loop'
>>         from org/jruby/RubyKernel.java:1284:in `catch'
>>         from org/jruby/RubyKernel.java:1284:in `catch'
>>         from /Users/eric/.rvm/rubies/jruby-1.7.8/bin/irb:13:in `(root)'
>> 
>> You can specify gems to package with your Shoes app in your `app.yaml` 
file. See the example here:
>> 
>>     https://github.com/shoes/shoes4/blob/master/app.yaml
>> 
>> 
>> > 3) I can't seem to run my app from the command line either. When I try
>> >
>> >
>> > $ bin/shoes Tracker/pkg/Tracker
>> >
>> > or
>> >
>> > $ bin/shoes Tracker/pkg/Tracker.app
>> >
>> >   Then I get this error message
>> >
>> > "IOError: /Users/KC/shoes4/Tracker/pkg/Tracker.app (No such file or 
directory)"
>> >
>> > But I assure you the app sitting in exactly the path it describes.
>> >
>> 
>> You can’t run a packaged app with `bin/shoes`. You would want to run it
like this:
>> 
>> $ open Tracker/pkg/Tracker.app
>> 
>> (or by double-clicking it, like you did above)
>> 
>> > 4) And lastly, I see that the packager currently packages MacOS .app 
files, and that it packages .jar files. But I don't know how .jar files 
relate to getting a standalone .exe for windows. Does jar get turned into 
a .exe somehow, or is shoes4 just not .exe compatible yet?
>> 
>> Ultimately, we will wrap the .jar in a .exe, but for now, no there 
isn’t a .exe package. You can package your app as a .jar, though, and run 
it like any old .jar:
>> 
>> java -jar Tracker/pkg/Tracker.jar
>> 
>> Thanks for testing, as always!
>> 
>> Eric
> 
> 
> 
> -- 
>  "If there is an exception to every rule, then every rule must have at 
least one exception; the exception to this one being that it has no 
exception."