Package app in Shoes4 - ruby

I used Shoes4 to make a GUI for my ruby app. Now I'm packaging this app, but something's wrong.
I followed this https://github.com/shoes/shoes4 to package.
'rake gem' gave me:
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
org/jruby/RubyKernel.java:1081:in `load'
org/jruby/RubyKernel.java:1101:in `eval'
/Users/xxxxxxx/.rvm/gems/jruby-1.7.13/bin/jruby_executable_hooks:15:in `(root)'
(See full trace by running task with --trace)
'gem install pkg/shoes-4.0.0.pre1.gem' gave me:
ERROR: Could not find a valid gem 'pkg/shoes-4.0.0.pre1.gem' (>= 0) in any repository
'bin/shoes -p swt:app path/to/directory-of/your-shoes-app.rb' still packaged my app (I coded in a Mac). However, the app won't run on Macs and it said 'quit unexpectedly'. The funny thing is that the app runs well in a Windows 7.
Have I done something wrong? How am I supposed to make the app work on Macs?
Thanks in advance.

Packaging is still a baby and sadly breaks some times.
We fixed a couple of packaging bugs (especially some for Mac) in the last months. I'd welcome you to try again fresh from master of shoes.
If the problem persists, please open an issue over at Shoes4 so we can tackle it appropriately :)

Related

Why did my minitest/pride alias break?

Silly, cosmetic question for everyone.
I take pride in my testing. That is, I like to use minitest/pride. Unfortunately, not everyone on my team is a fan, so I have activated it in the past using the command line instead of modifying the code by setting an alias to this:
RUBYOPT=-rminitest/pride bex rake`
(bex is an alias to bundle exec, and the default rake task runs our tests.)
Recently, we updated the ruby version of our project from 1.9.3 to 2.2.0. This has broken my alias, and now when I try to run it, I get this error instead:
/Users/cf5455/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- minitest/pride (LoadError)
from /Users/cf5455/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
My best guess as to why this is happening is that MiniTest was changed since our last Ruby version and pride has been renamed or moved, but I have not been successfully able to Google its new name or location.
Does someone know a way that I can fix my arguments to get pride working again?
Duplicated your error by switching to ruby 2.3.0. I just ran the tests before installing any gems.
I managed to get the tests running with your alias by simply doing a gem minitest install. Not sure if your problem is caused by the same reason since I'm using rbenv for managing my rubies and gems but it does feel like you are having a package management issue. Hope this helps.

Undefined method Zip::ZipOutputStream.write_buffer on Heroku

I'm making a basic Sinatra app to play around with the Passbook gem.
My app runs fine on localhost, but when I try and run it on Heroku I get this error message:
/app/vendor/bundle/ruby/2.0.0/gems/passbook-0.2.1/lib/passbook/pkpass.rb:122:in `outputZip'
/app/vendor/bundle/ruby/2.0.0/gems/passbook-0.2.1/lib/passbook/pkpass.rb:60:in `stream'
/app/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.4/lib/sinatra/base.rb:1593:in `call'
NoMethodError - undefined method `write_buffer' for Zip::ZipOutputStream:Class:
This happens when I call the line passbook.stream.string in my app file.
I don't think Passbook is the problem here - it seems that the class method write_buffer exists in the version of Zip::ZipOutputStream on my local machine but isn't there on Heroku. Why is this? How can I get around it?
I've tried including both zip and rubyzip in my Gemfile, individually and at the same time, and neither of them solve the issue.
Whenever I see something like this, I always ask myself Do you have Dev/Prod parity?.
So:
What Ruby version do you use locally, and does it differ from what you're using on Heroku?
Do you specify a Ruby version in your Gemfile?
How do you run locally? Do you use bundle exec to ensure you run in the same way, with the same gems?
Finally figured it out.
When I ran ruby app.rb, things worked locally, but when I ran bundle exec ruby app.rb, I got the same error as I did on heroku.
I upgraded to the latest version of passbook (which was just updated today to handle the latest changes to rubyzip), but things still didn't work.
Turns out I needed to remove gem 'zip' from my Gemfile and just include gem 'rubyzip' - previously I had both.

compass failing to load singularitygs gem

Trying to get a new project set up using Singularity.gs but I keep running into a snag with Compass.
First I used Terminal to install the necessary Ruby Gems (sass, compass, singularitygs, respectively).
Next I created a new project using the command:
compass create project1 -r singularitygs --using singularitygs
In the directory of my choosing.
At this point, in an effort to make life easier I've also attempted to use offerings like Scout (http://mhs.github.io/scout-app/) and/or Compass.app (http://compass.handlino.com/) so I can take advantage of a more user-friendly GUI.
I'm running into problems using either of these apps however, so I'm assuming it has something to do either with my Ruby gem install of singularitygs or with the creation of a new project.
Specifically, once I have a target directory and folder structure in place, I'll attempt to "watch" the sass folder and get an error that looks like:
(Compass)
no such file to load -- singularitygs
org/jruby/RubyKernel.java:1062:in `require'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/require_patch.rb:6:in `require'
or
(Scout)
LoadError on line 1038 of org/jruby/RubyKernel.java: no such file to load -- singularitygs
/Applications/Scout.app/Contents/Resources/vendor/gems/gems/compass
0.12.2/lib/compass/configuration/data.rb:161:in `require'
Strangely enough, I also get a very similar error message in Scout if I try to watch a Sass folder inside of a project that's using Foundation (having also installed the zurb-foundation ruby gem previously)
I am SUPER new to getting Sass / Compass set up so I'm definitely feeling a bit out of my element. I know this is probably not the easiest thing to diagnose from my description, but I'm not sure what I'm doing wrong. Hopefully I've managed to describe my issue clearly enough. Bear with me if any of this appears vague or incomplete, definitely not my intention.
Thanks so much.
Apps like Scout and Compass.app come bundled with their own versions of Ruby so even though you installed the gems on your computer they are not installed when compiling from those apps.
Here is how to make Compass.app use the version of Ruby on your computer. Open preferences and check “Custom”. Note your path may be different:

Building CompassApp (jruby app) executable from source on Windows

I would like to build the executable of CompassApp, a GUI application that lets webdesigners compile stylesheets by using SASS and Compass without using the command line.
The source can be found on GitHub here: https://github.com/handlino/CompassApp.
CompassApp is a an application developed in Jruby.
From the GitHub webpage of the project:
If you want to build your own copy, you will need JRuby and rawr
I am using Windows 7 as operating system for my webdesign projects. I never built a jruby app from source. It seems on linux it's easier to install the required things, anyway i'm using Windows now.
First i cloned the GitHub repository.
Then i installed jruby.
Now i should install rawr (https://github.com/rawr/rawr)
It seems that rawr also requires javac and rake
I saw that rawr and rake are 2 ruby gems.
So how do i install those 2 ruby gems for jruby on Windows?
And how do i build CompassApp from source after i have everything i need?
I would need a step by step guide from the install of the requirements
to the build of the application.
(i never used jruby in the past).
If someone of you develops apps in jruby i think that can help me easily.
I thank you in advance.
#Fabio Hi, we made Compass.app and Fire.app :-)
It is easy to build Compass.app on OS X or Linux. We have a (almost) step by step guide about building Fire.app on the GitHub wiki and it can be applied to Compass.app too: https://github.com/handlino/FireApp/wiki
We have never tried to build it on Windows, and do not think it can be done easily.
I'm trying to do a similar thing, but in my case only package the gems in a self-contained executable jar. the docs are not very descriptive and some are outdated.
I tried rawr but managed to get further with warbler
here's what I did: I created a folder named jrcompass and installed compass into it:
c:\test\jrcompass>%JRUBY%\jruby -S gem install compass -i .
I installed warbler and then ran the warble command in that folder:
C:\test\jrcompass>c:\apps\jruby\bin\jruby -S warble
that created a ~20MB jar file named jrcompass.jar which is farther than I got with rawr.
now I'm trying to execute the jar with:
C:\test\jrcompass>java -jar jrcompass.jar
and I get the following error below. I hope that this will help you make progress. please let me know if you figure it out.
Gem::LoadError: Could not find compass (>= 0) amongst [rake-0.9.2.2]
to_specs at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:247
to_spec at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:256
gem at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems.rb:1231
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/jrcompass/bin/compass:22
load at org/jruby/RubyKernel.java:1046
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
require at org/jruby/RubyKernel.java:1027
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
(root) at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1

Gitorious: git-poller won't start

I just installed a fresh gitorious on my server and wanted to test it when I found out that the git-poller didn't run. And it also didn't want to start.
I followed this guide: http://gitorious.org/gitorious/pages/DebianSqueezeInstallation, my system is Debian Squeeze and Ruby -v says ruby 1.8.7
Everything from that guide works so far. The system is up and running but I can't start the poller. All the poller writes into the logs is the following:
tmp/pids/poller.log
*** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
#<MissingSourceFile: no such file to load -- user_auto_completions_helper>
*** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
#<NoMemoryError: failed to allocate memory>
#<SystemStackError: stack level too deep>
#<fatal: exception reentered>
#<LoadError: no such file to load -- daemons>
#<TypeError: Expected a filter, an endpoint, a callable or a list of any of these.>
#<NameError: uninitialized constant ActiveMessaging>
#<MissingSourceFile: no such file to load -- user_auto_completions_helper>
tmp/pids/poller.output
/home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant ActiveMessaging (NameError)
from /home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
from /home/clients/client1/web85/web/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
from /home/clients/client1/web85/web/lib/gitorious/messaging/stomp_poller.rb:13
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in `load'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in `start_load'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:292:in `start'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/controller.rb:70:in `run'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:143:in `run'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `call'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `catch_exceptions'
from /var/lib/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:142:in `run'
from script/poller:30
I'm using ispconfig as a webserver management tool, that's where the weird paths are from. I changed all paths from the howto to fit, tho.
Anybody got an idea? I can provide more material if needed, but I just don't know what could be usefull. This is my first question on stackoverflow so please don't shoot me if I didn't do everything right :)
After a lot of reading and trial and error (I started about 3 times from scratch, trying Ruby 1.9.2 and REE both from source and with RVM) I tried another howto[1] which had one big difference to the first one: It suggested downloading and installing Rubygems 1.4.2 instead of the apt-version of Rubygems.
At first I didn't want to do that because I was afraid that it would break my system (there are a lot of other things running on that server, including Redmine) which it did, but after I re-installed all missing gems everything worked again.
Now everything (Gitorious and Redmine) is working with apt-version of Ruby 1.8.7 and the non-apt-version of Rubygems 1.4.2.
[1] http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server/
Since I stumbled upon another, hopefully last problem:
I installed gitorious for my standard web user (in order to respect ISPConfig's policy) and made a new git-user for the repositories. To be able to exchange data I added both to the same usergroup and fixed the permissions.
The problem I ran into was that the git poller added new repositories for his own, that means "git:git" instead of "git:sharedgroup". To fix this you just have to set the default group id for the git-folder (/var/git in my case):
chgrp -R <group_name> /var/git
chmod -R g+s /var/git
It appears that the two commands above did work but adding a new project broke everything again because the git-poller added a folder for the project and the repository which resulted in the repository-folder having the wrong owner again.
I (hopefully) fixed that with changing my /etc/init.d/git-poller script from
/bin/su - git -c "cd /var/www/git.mydomain.com/web;RAILS_ENV=production script/poller $#"
to
/bin/su - git -c "newgrp <group_name> && cd /var/www/git.mydomain.com/web;RAILS_ENV=production script/poller $#"

Resources