Bug 831501 - Won't start, syntax error in screenruler.rb:35
Won't start, syntax error in screenruler.rb:35
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: screenruler (Show other bugs)
17
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Deji Akingunola
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 03:12 EDT by Jaša Bartelj
Modified: 2013-07-20 05:52 EDT (History)
15 users (show)

See Also:
Fixed In Version: screenruler-0.96-1.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-20 05:47:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch. Fix Encoding first. (1.35 KB, patch)
2012-07-30 10:33 EDT, mvondomaros
no flags Details | Diff
Updated patch to include encoding (1.55 KB, patch)
2013-03-20 14:32 EDT, Russell Harrison
no flags Details | Diff

  None (edit)
Description Jaša Bartelj 2012-06-13 03:12:10 EDT
Description of problem:
screenruler has a syntax error in its main script and therefore will not start

Version-Release number of selected component (if applicable):
$ rpm -q screenruler
screenruler-0.90-0.2.bzr27.fc17.noarch

How reproducible:
Every startup

Steps to Reproduce:
1. $ screenruler

Actual results:
$ screenruler
./screenruler.rb:35: invalid multibyte char (US-ASCII)
./screenruler.rb:35: invalid multibyte char (US-ASCII)
./screenruler.rb:35: syntax error, unexpected $end, expecting ']'
APP_ARTISTS				= ['János Horváth <horvathhans@gmail.com>']
           				       ^

Expected results:
Normal program startup.

Additional info:
$ find /usr -type f -name screenruler.rb
/usr/share/screenruler/screenruler.rb
...
$ uname -a
Linux tardisII 3.4.0-1.fc17.x86_64 #1 SMP Sun Jun 3 06:35:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ rpm -q gnome-shell
gnome-shell-3.4.1-5.fc17.x86_64
Comment 1 Mark Knoop 2012-07-03 04:42:54 EDT
Editing /usr/share/screenruler/screenruler.rb and commenting out that line does not actually solve the problem though.

$ screenruler 
Loading libraries...
/usr/share/gems/gems/gtk2-1.1.3/lib/gtk2.rb: line 12
   Gtk-MESSAGE **:Failed to load module "pk-gtk-module"
/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- ruler_window (LoadError)
	from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `block in require'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `each'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `require'
	from ./screenruler.rb:47:in `<main>'
Comment 2 Mukundan Ragavan 2012-07-26 16:50:28 EDT

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 3 mvondomaros 2012-07-30 08:41:15 EDT
There are two bugs:
1)
The character encoding of screenruler.rb should be set to utf-8. This is probably a Fedora specific problem.

2)
Screenruler has not been ported to Ruby 1.9. yet. There is already a wish to do so on the project's launchpad. To make it work, use an older ruby version, or remove "ruler_window" from the line which says

require [some ruby files],ruler_window, [more ruby files]

and add a line

require_relative ruler_window

Repeat this for every file which Ruby complains about.
Comment 4 tosca 2012-07-30 09:42:19 EDT
Thanks for your answer. I edited the screeruler.rb according to your advice. For the UTF problem, I uncommented the 1st line and changed it to:
encoding:utf-8

 but I get another error message on the following line:

./screenruler.rb:36: invalid multibyte char (US-ASCII)
./screenruler.rb:36: invalid multibyte char (US-ASCII)
./screenruler.rb:36: syntax error, unexpected $end, expecting ']'
APP_ARTISTS				= ['János Horváth <horvathhans@gmail.com>']
Comment 5 tosca 2012-07-30 10:02:22 EDT
It seems the encoding command was not the right one... I put back the previous one, and have no more syntax error; but this message:

Loading libraries...
/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- preferences_window (LoadError)
	from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `block in require'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `each'
	from /usr/share/screenruler/utils/addons_ruby.rb:59:in `require'
	from ./screenruler.rb:48:in `<main>'
Comment 6 mvondomaros 2012-07-30 10:33:25 EDT
Created attachment 601287 [details]
Patch. Fix Encoding first.

You need to do the same for "preference_window" and also for "ruler_popup_menu" in "ruler_window.rb". I attached a patch.
Comment 7 tosca 2012-07-30 10:49:41 EDT
The patch works fine. Thanks a lot for helping.
Comment 8 Rasmus Kaj 2012-08-10 05:31:01 EDT
I got the same problem (also with screenruler-0.90-0.2.bzr27.fc17.noarch), and the patch work find (after adding "# -*- encoding: utf-8; -*-" as the second line of screenruler.rb).

Can this patch and the encoding fix be applied to the package?
Comment 9 Russell Harrison 2012-11-30 11:27:59 EST
(In reply to comment #6)
> Created attachment 601287 [details]
> Patch. Fix Encoding first.
> 
> You need to do the same for "preference_window" and also for
> "ruler_popup_menu" in "ruler_window.rb". I attached a patch.

I can confirm this patch fixes the issue on my machine as well.
Comment 10 Zirneklitis 2013-02-04 03:16:04 EST
(In reply to comment #8)
> .. patch work fine (after adding "# -*- encoding: utf-8; -*-" as the
> second line of screenruler.rb).
> ..

The same applies to the Fedora 18 release:
screenruler.noarch  0.90-0.3.bzr27.fc18
Comment 11 Zdeněk Zikán 2013-03-09 19:50:07 EST
Could somebody please fix it? There is working* patch submitted for more than half a year, so what's the problem to apply it?

(*) tested on my F18, screenruler 0.90-0.3.bzr27.fc18
Comment 12 Russell Harrison 2013-03-20 14:32:55 EDT
Created attachment 713404 [details]
Updated patch to include encoding

I updated the patch to include the encoding fix as well.  This is working on F18 for me.

$ rpm -q screenruler
screenruler-0.90-0.3.bzr27.fc18.noarch
Comment 13 Mukundan Ragavan 2013-03-20 15:06:21 EDT
Applying this patch fixed the problem with screenruler for me too!


$ rpm -qa screenruler
screenruler-0.90-0.3.bzr27.fc18.noarch

$ screenruler 
Loading libraries...
Connecting to GConf...
Creating windows...
Reading settings...
Presenting ruler...

And the ruler appears! Good Good!
Comment 14 Robert Buchholz 2013-05-08 05:19:52 EDT
upstream: https://bugs.launchpad.net/screenruler/+bug/925835
Comment 15 Zirneklitis 2013-06-10 15:14:23 EDT
For testing the 0.9.6 version with applied patches as an RPM can be found here:
http://priede.bf.lu.lv/ftp/Linux/Fedora/Utilities/screenruler-F18/screenruler-0.96-K01.noarch.rpm
Comment 16 Fedora Update System 2013-06-10 19:54:19 EDT
screenruler-0.96-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/screenruler-0.96-1.fc18
Comment 17 Fedora Update System 2013-06-10 19:54:47 EDT
screenruler-0.96-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/screenruler-0.96-1.fc19
Comment 18 Fedora Update System 2013-06-10 19:55:14 EDT
screenruler-0.96-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/screenruler-0.96-1.fc17
Comment 19 Fedora Update System 2013-06-11 13:56:15 EDT
Package screenruler-0.96-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing screenruler-0.96-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10576/screenruler-0.96-1.fc19
then log in and leave karma (feedback).
Comment 20 Fedora Update System 2013-06-29 14:41:22 EDT
screenruler-0.96-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Zirneklitis 2013-07-03 08:00:57 EDT
Must be pushed to the Fedora 18 stable repository as well.
Comment 22 Cristian Ciupitu 2013-07-09 15:41:57 EDT
+1 for pushing it to Fedora 18.
Comment 23 Fedora Update System 2013-07-20 05:47:08 EDT
screenruler-0.96-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 24 Fedora Update System 2013-07-20 05:52:15 EDT
screenruler-0.96-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.