Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Typo in os.rb prevents detecting linux environment #43

Closed
wants to merge 1 commit into from

3 participants

@barraponto

It seems silly, but I tested locally and that's all it takes to load libnotify gem as a dependency when building.

@barraponto

Should fix #42 and #34.

@stephenmckinney
Collaborator

That extra space doesn't actually change the statement. The fix for #42 and #34 is that Linux users need to install libnotify (the Linux package) not libnotify the gem. See: https://github.com/splattael/libnotify#installation

@stephenmckinney
Collaborator

You can verify this by running gem dependency pomo.

On OS X I get:

Gem pomo-2.1.3
  commander (~> 4.1)
  growl (~> 1.0)
  octokit (~> 1.19)
  terminal-notifier (~> 1.4)

You should get:

Gem pomo-2.1.3
  commander (~> 4.1)
  libnotify (~> 0.8)
  octokit (~> 1.19)
@barraponto

@stephenmckinney I had the libnotify package installed, but not the gem. yet I expected the gem to be required.

@stephenmckinney
Collaborator

What's the output from gem dependency pomo?

@jsgarvin

I'm on Ubuntu 12.04 and the libnotify4 package (which is what's available in apt) is already installed. When I run gem dependency pomo, I get...

Gem pomo-2.1.3
  commander (~> 4.1)
  growl (~> 1.0)
  octokit (~> 1.19)
  terminal-notifier (~> 1.4)

pomo initconfig returns

/home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/runner.rb:365:in `block in require_program': program version required (Commander::Runner::CommandError)
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/runner.rb:364:in `each'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/runner.rb:364:in `require_program'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/runner.rb:52:in `run!'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
/home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- libnotify (LoadError)
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/pomo-2.1.3/lib/pomo/notifier/libnotify_notifier.rb:1:in `<top (required)>'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/pomo-2.1.3/lib/pomo/notifier.rb:2:in `<top (required)>'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/pomo-2.1.3/lib/pomo.rb:3:in `<top (required)>'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/gems/pomo-2.1.3/bin/pomo:5:in `<top (required)>'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/bin/pomo:19:in `load'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/bin/pomo:19:in `<main>'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
from /home/jsgarvin/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
@jsgarvin

Upon further investigation, the problem seems to be with installing from rubygems and not already having the libnotify gem installed.

From a clean slate without the libnotify gem already installed...
When I install pomo from rubygems, it installs the growl and terminal-notifier gems, not the libnotifygem, and I get the above errors.

From a clean slate, with the libnotify gem already installed,
When I install pomo from rubygems, it does not install growl and terminal-notifier and things seem to work fine.

From a clean slate, without the libnotify gem already installed,
When I clone the git repo, build the gem locally, and install the locally built .gem file, it installs the libnotify gem as expected and all works fine. Adding the space in the os.rb file as suggested above doesn't make any difference in this case. Either way, the locally built gem installs properly.

@stephenmckinney
Collaborator

@jsgarvin I'd like to fix this issue, but don't have a linux box to test this on. Could you tell me the output of this on your Ubuntu machine:

require 'rbconfig'
RbConfig::CONFIG['host_os']
@jsgarvin

Sure...

1.9.3p327 :001 > require 'rbconfig'
 => false 
1.9.3p327 :002 > RbConfig::CONFIG['host_os']
 => "linux-gnu" 
@stephenmckinney
Collaborator

Found the problem:

It appears you can't use conditionals in a gemspec (https://github.com/visionmedia/pomo/blob/master/pomo.gemspec#L26-L28) because gemspec is serialized into YAML, which doesn't contain executable code. Since I run gem build on my platform the OS X dependencies are locked-in. Hence you're issue. Now looking into a solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. @barraponto
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/pomo/os.rb
View
2  lib/pomo/os.rb
@@ -5,7 +5,7 @@ module OS
module_function
def linux?
- (/linux/ =~ RbConfig::CONFIG['host_os']) !=nil
+ (/linux/ =~ RbConfig::CONFIG['host_os']) != nil
end
def mac?
Something went wrong with that request. Please try again.