samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 115 forks source link

cannot load timetrap #159

Closed ToadJamb closed 6 years ago

ToadJamb commented 7 years ago

I get the following error after installing timetrap and attempting to run it from the command line:

cannot load such file -- timetrap: ["/home/toadjamb/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'", "/home/toadjamb/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'", "/home/toadjamb/.rvm/gems/ruby-2.3.3@global/gems/timetrap-1.14.1/bin/timetrap:3:in `<top (required)>'", "/home/toadjamb/.rvm/gems/ruby-2.3.3@global/bin/timetrap:22:in `load'", "/home/toadjamb/.rvm/gems/ruby-2.3.3@global/bin/timetrap:22:in `<main>'"]

I have other systems that I have used to run timetrap for quite some time with no issues. It's entirely possible that it's a problem with my environment, but I'm not sure what it would be as other executable gems (bundler, rake, plus some I created myself, etc) seem to run just fine.

One curious point is that the error raised is a SystemExit and not a LoadError, so the rescue block in the binary never gets hit. If I remove require 'timetrap' and just use the code in the rescue block, timetrap runs just fine. I'm not 100% sure this is a timetrap issue, but other executable gems in my global gemset appear to work fine, so that leads me to think that maybe it is.

jostber commented 7 years ago

I had a similar experience on a machine with cygwin yesterday after a Ruby upgrade. Had then to install ruby-dev and then "gem install bigdecimal" to make it work again.

michaelb87 commented 7 years ago

Same problem on Ubuntu 17.04 ruby-dev is installed

ToadJamb commented 7 years ago

I would be extremely hesitant to look toward installation of ruby-dev as a 'fix'. It is a project that has not been updated in 5 years (at the time that I write this), has a readme that references only 1.9.3-p194 as a supported ruby (which itself has been unsupported for over 2 years), AND is a project specifically for deploying ruby on rails apps, which means that if it DOES somehow affect other gem binaries, that's probably not a good thing.

samg commented 7 years ago

I was able to replicate this issue. As far as I can tell it's related to some subtle difference in how load_paths are set up in new ruby installs. I believe I've fixed the issue in https://rubygems.org/gems/timetrap/versions/1.14.2 by updating the syntax for requiring the timetrap lib files relative to the bin.

Could you let me know if this resolves the error on your install and close out the issue if so.

Thanks!

michaelb87 commented 7 years ago

Confirming, it works again.

Thx

jostber commented 6 years ago

Seems this can be closed.