New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in os.rb prevents detecting linux environment #43

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@barraponto

barraponto commented Mar 21, 2013

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

@barraponto

This comment has been minimized.

Show comment
Hide comment
@barraponto

barraponto Mar 21, 2013

Should fix #42 and #34.

barraponto commented Mar 21, 2013

Should fix #42 and #34.

@stephenmckinney

This comment has been minimized.

Show comment
Hide comment
@stephenmckinney

stephenmckinney Mar 21, 2013

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

Collaborator

stephenmckinney commented Mar 21, 2013

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

This comment has been minimized.

Show comment
Hide comment
@stephenmckinney

stephenmckinney Mar 21, 2013

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)
Collaborator

stephenmckinney commented Mar 21, 2013

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

This comment has been minimized.

Show comment
Hide comment
@barraponto

barraponto Mar 21, 2013

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

barraponto commented Mar 21, 2013

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

@stephenmckinney

This comment has been minimized.

Show comment
Hide comment
@stephenmckinney

stephenmckinney Mar 21, 2013

Collaborator

What's the output from gem dependency pomo?

Collaborator

stephenmckinney commented Mar 21, 2013

What's the output from gem dependency pomo?

@jsgarvin

This comment has been minimized.

Show comment
Hide comment
@jsgarvin

jsgarvin May 29, 2013

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 commented May 29, 2013

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

This comment has been minimized.

Show comment
Hide comment
@jsgarvin

jsgarvin May 29, 2013

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.

jsgarvin commented May 29, 2013

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

This comment has been minimized.

Show comment
Hide comment
@stephenmckinney

stephenmckinney May 30, 2013

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']
Collaborator

stephenmckinney commented May 30, 2013

@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

This comment has been minimized.

Show comment
Hide comment
@jsgarvin

jsgarvin May 30, 2013

Sure...

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

jsgarvin commented May 30, 2013

Sure...

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

This comment has been minimized.

Show comment
Hide comment
@stephenmckinney

stephenmckinney May 30, 2013

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...

Collaborator

stephenmckinney commented May 30, 2013

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