Bug 831501

Summary: Won't start, syntax error in screenruler.rb:35
Product: [Fedora] Fedora Reporter: Jaša Bartelj <bartmon>
Component: screenrulerAssignee: Deji Akingunola <dakingun>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: allenhalsey, butkovic, cristian.ciupitu, dakingun, dan, fedora, Jacek.Pliszka, kaj, k_a_r_l_o_, mark, mnaugendre, mvondomaros, nonamedotc, rbu, zdenek.zikan
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: screenruler-0.96-1.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-20 09:47:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch. Fix Encoding first.
none
Updated patch to include encoding none

Description Jaša Bartelj 2012-06-13 07:12:10 UTC
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>']
           				       ^

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 08:42:54 UTC
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 20:50:28 UTC

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 3 mvondomaros 2012-07-30 12:41:15 UTC
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 13:42:19 UTC
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>']

Comment 5 tosca 2012-07-30 14:02:22 UTC
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 14:33:25 UTC
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 14:49:41 UTC
The patch works fine. Thanks a lot for helping.

Comment 8 Rasmus Kaj 2012-08-10 09:31:01 UTC
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 16:27:59 UTC
(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 08:16:04 UTC
(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-10 00:50:07 UTC
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 18:32:55 UTC
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 19:06:21 UTC
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 09:19:52 UTC
upstream: https://bugs.launchpad.net/screenruler/+bug/925835

Comment 15 Zirneklitis 2013-06-10 19:14:23 UTC
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 23:54:19 UTC
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 23:54:47 UTC
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 23:55:14 UTC
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 17:56:15 UTC
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 18:41:22 UTC
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 12:00:57 UTC
Must be pushed to the Fedora 18 stable repository as well.

Comment 22 Cristian Ciupitu 2013-07-09 19:41:57 UTC
+1 for pushing it to Fedora 18.

Comment 23 Fedora Update System 2013-07-20 09:47:08 UTC
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 09:52:15 UTC
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.