Comments (11)
Ah for some reason it's working now. And the same version, 2.3.3. Might as well close this.
from filewatcher.
Have you properly followed the INSTALL and QUICK START instructions?
from filewatcher.
Will look into it. My beef so far is that I'm expecting it to duplicate any shell that I open manually. More later, if I find anything. Cheers
from filewatcher.
Yes. Like I said, it's only Filewatcher that has the issue. Using ruby app.rb
in the terminal works just fine. The very same instructions I've given Filewatcher. The issue is not with geokit. I'm using geokit just fine.
from filewatcher.
$ ruby -v
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
# app.rb
puts RUBY_VERSION
puts require 'geokit'
$ ruby app.rb
2.3.4
true
$ filewatcher 'app.rb' --exec
# Ctrl+S for app.rb
2.3.4
true
# Ctrl+S for app.rb
2.3.4
true
# Ctrl+S for app.rb
2.3.4
true
No problems for me.
Are you sure you are running a file for the test and from filewatcher under the same version of Ruby?
Try to add this code:
puts RUBY_VERSION
from filewatcher.
Happening again. IRB loads require 'linkedin'
just fine. Calling ruby in the terminal to load the very same file, works fine. The only difference between these three methods is filewatcher.
Is there any place I can look? RUBY_VERSION returns 2.3.3, which is supporting the exit version as well:
/Users/rich/app.rb:76:in `require': cannot load such file -- linkedin (LoadError)
from /Users/rich/app.rb:76:in `<main>'
^Z
[5]+ Stopped filewatcher "/users/rich/app.rb" "clear; ruby ~/app.rb"
HQ:~ rich$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
HQ:~ rich$
from filewatcher.
That version was 2.3.3. 2.4.0 works fine.
from filewatcher.
I'm finding that filewatcher isn't loading my .bash_profile paths:
tpp PATH: "/Users/rich/.rvm/gems/ruby-2.4.0/bin:/Users/rich/.rvm/gems/ruby-2.4.0@global/bin:/Users/rich/.rvm/rubies/ruby-2.4.0/bin:/usr/local/opt/postgresql-9.5/bin:/usr/local/sbin:/usr/sbin:/usr/X11/bin:/usr/local/bin:/usr/bin:/opt/local/bin:/opt/local/sbin:/users/rich/.rvm/rubies/default:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/rich/.rvm/bin"
Both are initiated in my login shell, so I assumed they would both take the same paths. Vast difference in gem list
. app
has a short list, and tpp
has the list I am expecting. So I found the path looking for gems is different.
Why would filewatcher
not adopt the .bash_profile paths? rvm info
is what gave me this information, as environment PATHs are indeed represented above. All else is the same, including GEM_HOME.
Any idea why the .bash_profile
isn't sourced? Cheers
from filewatcher.
@daBee TL;DR: My sincere advice: try rbenv
, please.
filewatcher
uses Process
class from Ruby core, and only. So, this isn't filewatcher
's problem: or Process
class from Ruby core, or rvm
.
I think that Ruby core works good, and I did not have a single problem with filewatcher
, although I use it very often and strongly, in a team of a several developers on several OS (except Windows, for now).
So, I think you should try to replace rvm
with rbenv
.
That's my variables from shell:
$ echo $PATH
/home/alex/.rbenv/shims /home/alex/go/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl
$ echo $GEM_HOME
$ echo $GEM_PATH
That's my file with Ruby-code:
# env.rb
puts 'Backticks:'
puts `echo $PATH`
puts
puts '%x:'
puts %x{echo $PATH}
puts
puts "ENV['PATH']"
puts ENV['PATH']
That's its output:
$ ruby env.rb
Backticks:
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
%x:
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ENV['PATH']
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
That's filewatcher
run with --dontwait
(new name is immediate
) option:
$ filewatcher '**/*' 'ruby env.rb' -d
Backticks:
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
%x:
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ENV['PATH']
/home/alex/.rbenv/versions/2.4.1/bin:/usr/lib/rbenv/libexec:/home/alex/.rbenv/plugins/ruby-build/bin:/home/alex/.rbenv/shims:/home/alex/go/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
^C
So, I see no problems for me or filewatcher
with rbenv
.
And, for record, I'm using fish-shell
. And I'm sure that the .bash_profile
itself is not a stumbling block. Here the problem with ENV
variable, I think, which is already compiled taking into account content of the .bash_profile
file, and which should be thrown to the code by rvm
in your case.
Well, I thought more, and remembered something else: Ruby's require
method looking in directories from $LOAD_PATH
constant, which is defined by rvm
in your case, again, I think. You can read more about this constant in the Internet.
New code:
# env.rb
puts '$LOAD_PATH:'
puts $LOAD_PATH
Output:
$ ruby env.rb
$LOAD_PATH:
/home/alex/.rbenv/rbenv.d/exec/gem-rehash
/home/alex/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/x86_64-linux
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby/2.4.0/x86_64-linux
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby
/home/alex/.rbenv/versions/2.4.1/lib/ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/2.4.0/x86_64-linux
Output from filewatcher
:
$ filewatcher '**/*' 'ruby env.rb' -d
$LOAD_PATH:
/home/alex/.rbenv/rbenv.d/exec/gem-rehash
/home/alex/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/x86_64-linux
/home/alex/.rbenv/versions/2.4.1/lib/ruby/site_ruby
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby/2.4.0/x86_64-linux
/home/alex/.rbenv/versions/2.4.1/lib/ruby/vendor_ruby
/home/alex/.rbenv/versions/2.4.1/lib/ruby/2.4.0
/home/alex/.rbenv/versions/2.4.1/lib/ruby/2.4.0/x86_64-linux
^C
from filewatcher.
I'll leave this issue open for now, but I'm waiting for your feedback, please.
from filewatcher.
rbenv works great. Completely moved over to rbenv.
from filewatcher.
Related Issues (20)
- The filewatch does not work if files are creating too fast HOT 5
- unexpected behavior on Windows and two callbacks on one DELETE on Linux HOT 3
- --restart flag support process kill with custom signal? HOT 3
- filewatcher loops infinitely when executing a script that invokes ssh HOT 9
- "Batching" all changes into one event HOT 3
- Sync to database example HOT 1
- Question regarding API HOT 3
- How do I know which directory has changed when there is a change HOT 1
- Stable release soon? HOT 2
- Filewatcher not found in Ruby 3.2.2 HOT 13
- When used with multiple watch paths block vars are improperly assigned HOT 5
- Speed up tests HOT 1
- `Filewatcher` vs `FileWatcher` case change from rubygems HOT 4
- 1.0 Release -- event 'updated' raises NotImplementedError HOT 4
- Crash on file deletion (via executable) HOT 1
- Doesn't seem to work if repos have a dot in the name HOT 2
- Replace Gemnasium with Depfu
- Trollop dependency is deprecated HOT 9
- Switch from Travis CI to Cirrus CI HOT 1
- Detect rename HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filewatcher.