scrapper / postrunner

Application to manage FIT files such as those produced by Garmin fitness devices
GNU General Public License v2.0
62 stars 14 forks source link

Permission issue while using the gem installation #1

Closed st3rk closed 8 years ago

st3rk commented 9 years ago

After installing postrunner using ruby-gem, I was unable to launch the program as a standard user. The progam crashed with the following output:

~ ❯❯❯ postrunner import /media/sdd/GARMIN/ACTIVITY
/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- postrunner (LoadError)
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /var/lib/gems/2.1.0/gems/postrunner-0.0.9/bin/postrunner:4:in `<top (required)>'
    from /usr/local/bin/postrunner:23:in `load'
    from /usr/local/bin/postrunner:23:in `<main>'

Using strace, we can see it's a permission issue:

11:43:44.762611 open("/var/lib/gems/2.1.0/gems/postrunner-0.0.9/lib/postrunner.rb", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) <0.000040>

Actually, only root can read the file:

~ ❯❯❯ ls -l /var/lib/gems/2.1.0/gems/postrunner-0.0.9/lib/postrunner.rb
-rw-r----- 1 root root 561 Oct 10 11:37 /var/lib/gems/2.1.0/gems/postrunner-0.0.9/lib/postrunner.rb

The permission issue also exists for fit4ruby. After changing the read rights, everything goes smoothly:

root@yoshi:/home/brice# chmod -R a+r /var/lib/gems/2.1.0/gems/fit4ruby-0.0.6 /var/lib/gems/2.1.0/gems/postrunner-0.0.9/
root@yoshi:/home/brice# exit
~ ❯❯❯ postrunner import /media/sdd/GARMIN/ACTIVITY
INFO: No records file found at '/home/brice/.postrunner/records.yml'
INFO: New all-time running distance record: 7218.34 m
INFO: New 2015 running distance record: 7218.34 m
INFO: New all-time running speed record for 400 m: 0:02:22
INFO: New 2015 running speed record for 400 m: 0:02:22
INFO: New all-time running speed record for 500 m: 0:02:55
INFO: New 2015 running speed record for 500 m: 0:02:55
INFO: New all-time running speed record for 800 m: 0:04:41
INFO: New 2015 running speed record for 800 m: 0:04:41
INFO: New all-time running speed record for 1 km: 0:05:56
INFO: New 2015 running speed record for 1 km: 0:05:56
INFO: New all-time running speed record for 1 mi: 0:10:42
INFO: New 2015 running speed record for 1 mi: 0:10:42
INFO: New all-time running speed record for 2 km: 0:13:16
INFO: New 2015 running speed record for 2 km: 0:13:16
INFO: New all-time running speed record for 3 km: 0:20:28
INFO: New 2015 running speed record for 3 km: 0:20:28
INFO: New all-time running speed record for 5 km: 0:32:30
INFO: New 2015 running speed record for 5 km: 0:32:30
INFO: /media/sdd/GARMIN/ACTIVITY/5A763538.FIT successfully added to archive
INFO: Runtime config file '/home/brice/.postrunner/config.yml' written
postrunner import /media/sdd/GARMIN/ACTIVITY  5.63s user 0.39s system 87% cpu 6.887 total
scrapper commented 8 years ago

This issue should now be fixed with version 0.2.1.