Comments (20)
OK, I've merged #58 and this will be fixed in a v2.0.0 release shortly.
from chromedriver-helper.
This issue seems pretty intractable without making a breaking change.
Note that chromedriver-helper
is included by default in every new Rails project generated by rails new
, so it is very hard to avoid installing this gem on your system at some point. This particularly affects people who are learning Rails, as they are more likely to be following tutorials and doing other experiments involving rails new
. Once the gem gets installed, removing it entirely (and keeping it removed) is tedious.
The bundle config --path .bundle
solution works, but it is pretty brute-force. That would mean every project using its own copies of gems, which slows down bundle install
for developers that switch between many projects. I don't like the idea of having to change my global bundler config to work around one gem problem.
I think #58 is a great approach.
from chromedriver-helper.
Note that chromedriver-helper is included by default in every new Rails project generated by rails new
😱 🚒 I did not know that.
I've re-opened #58 and will take another look. I appreciate everyone's comments here!
from chromedriver-helper.
Have you tried adding the gem to your bundle? I believe this will address your issue, which I suspect is based in your $PATH containing an executable script chromedriver
but your bundle exec
environment does not.
from chromedriver-helper.
Have you tried adding the gem to your bundle? I believe this will address your issue, which I suspect is based in your $PATH containing an executable script chromedriver but your bundle exec environment does not.
Yes the 2 workarounds are:
- add
chromedriver-helper
to your Gemfile - remove chromedriver-helper gem, from the machine:
gem uninstall chromedriver-helper
The point is that if you're working on multiple projects, either all of them or non of them should have chromedriver-helper
which is less than ideal.
from chromedriver-helper.
Sorry, to be clear I meant to only install into your bundler environments. gem install
will put an executable into your global path. If you avoid the global install and only install into your projects, you shouldn't have a problem.
from chromedriver-helper.
Sorry, to be clear I meant to only install into your bundler environments. gem install will put an executable into your global path. If you avoid the global install and only install into your projects, you shouldn't have a problem.
Even if i install through bundler i still end up with a chromedriver
executable in my PATH. I've never did gem install chromedriver-helper
, only bundle install
.
Bundler work by installing the gem globally and then only selecting the ones in the Gemfile when you do bundle exec
.
$ which chromedriver
/usr/local/bin/chromedriver
$ mkdir -p /tmp/chtest ; cd /tmp/chtest
$ bundle init
$ echo 'gem "chromedriver-helper"' >> Gemfile
$ bundle install
Fetching gem metadata from https://rubygems.org/..............
Resolving dependencies...
Using io-like 0.3.0
Using archive-zip 0.11.0
Using bundler 1.16.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.4
Fetching chromedriver-helper 1.2.0
Installing chromedriver-helper 1.2.0
Bundle complete! 1 Gemfile dependency, 6 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ which chromedriver
~/.rvm/gems/ruby-2.4.0/bin/chromedriver
from chromedriver-helper.
@flavorjones Not true, at least if using rbenv - could be different with rvm
--- Adding chromedriver-helper to any project ends up with $HOME/.rbenv/shims/chromedriver
being installed which ends up being in the PATH at all times (even when not in that project), and prevents access to any system version of chromedriver installed, often leading to failures. Basically once you use chromedriver-helper
in one project you need to use it in all projects where chromedriver is needed.
from chromedriver-helper.
OK, I see now, thanks all for explaining more clearly. (I will note that the OP did indicate that installation was via gem install
which did lead me down the wrong path.)
I'm open to solutions here. This isn't a problem I have, personally, and it's not clear to me what the "right" way to solve it is. Any ideas?
from chromedriver-helper.
Given that no one really runs never mind - wouldn't work - but overall the solution would be to prevent a shim from being installed for chromedriver
manually (so no shim is really needed) -- I wonder what would happen if chromedriver
was not specified as an executable in the gemspec - would that prevent a shim being added for it, but still provide it in the path when in the bundle environment?chromedriver
from chromedriver-helper.
Another thing to try would be using a different shim name (chromedriver-helper
) for example. Then use Selenium::WebDriver::Chrome.driver_path=
to make capybara use that.
from chromedriver-helper.
@mfazekas In that case you'd probably just be better off using the webdrivers gem rather than chromedriver-helper
from chromedriver-helper.
@mfazekas In that case you'd probably just be better off using the webdrivers gem rather than chromedriver-helper
@twalpole can you ellaborate? The point is changing chromedirver-helper
so that it won't break projects not using it. I don't want to use any of those gems, i just don't want to have my projects broken just because i did bundle install
on a project using them.
I've suggested chaging the shim name to chromedriver-helper
from chromedriver
in chromedriver-helper
gem and also adding a minimal code to chromedriver-helper
helper gem to tell selenium-webdriver to default to this executable. That way if the gem will not shadow the system isntalled chromedriver
. AFAIK all uses of chromedriver ends up being through selenium-webdriver
gem, definetely the case with capybara
.
from chromedriver-helper.
To summarize: I think the problem here is when someone starts using / contributing to A_PROJECT
already using chromedriver-helper, then they find that ANOTHER_PROJECT
not using chromedriver-helper suddenly is broken.
I think: This won't happen if you're using rvm with separate gemsets for the two projects (and maybe other ruby management mechanisms) for A_PROJECT
. It also won't happen if you aren't using bundler for either project (but that seems rare).
If I have understood correctly, the problem is that the chromedriver
bin file is generated with bundler, and is then placed in the global path but shadows the original chromedriver
binary wherever that path is availble (ie for that ruby) but the bundle may not be available .
So...
Is there a way to customize the failure of the bin when if fails to find the gem to revert to ? (I think that that wrapper bin is created by bundler/rubygems rather than the chromedriver, but I may be wrong here)
I'm guessing this might happen to someone new to ruby and would be totally mystifying.
from chromedriver-helper.
from chromedriver-helper.
Is there a way to customize the failure of the bin when if fails to find the gem to revert to ? (I think that that wrapper bin is created by bundler/rubygems rather than the chromedriver, but I may be wrong here)
Yes, wrappers are generated by rubygems and n there seems to be no way to customize binstub generation there.
This is the code in rubygems where the scripts are generated:
from chromedriver-helper.
@flavorjones can you explain this note on #58:
Part of the value of chromedriver-helper is that it shadows the system-installed version (and calls it if it's present).
My understanding is that 99% of usecases is just adding the gem to Gemfile and running ui tests, (and this works fine with #58, as it tells capybara the chromedirver path to use). I assume small number of users are starting chromerdirver
directly from command line, and i'd argue that for those advanced uses a change in docs is just fine. Or am i missing something?
from chromedriver-helper.
Hi! I wanted to report an issue for this ages ago but I never got to it.
I asked the bundler
team about this and there's no really a good solution, but a good workaround is to use bundle config --path .bundle
so that gems are installed locally to each project and never shared.
But I hadn't thought about the solution proposed by @mfazekas in #57 (comment). That's backwards incompatible, but I think it would make the best behaved chromedriver-helper
.
This bug is quite hard to troubleshoot and makes contributing to some projects very painful... 😞
from chromedriver-helper.
I fully agree with you @mattbrictson, #58 is the way to go. And as mentioned by @mfazekas, it can be considered backwards incompatible, but it's going to be a transparent change for most users who only use this gem for UI tests. Just note that the bundle config --path .bundle
will be the default in bundler 2. I think it's a good move.
from chromedriver-helper.
😱 🚒 I did not know that.
Me neither, I just found out too!
Thanks so much for your work @flavorjones! ❤️
from chromedriver-helper.
Related Issues (20)
- unknown error: call function result missing 'value' for Selenium Send Keys even after chromedriver upgrade HOT 1
- Chromedriver picks up wrong version HOT 13
- No options to set log log-level and log-path HOT 6
- Using with Rails: "uninitialized constant Selenium" HOT 5
- Use LATEST_RELEASE file rather than guessing HOT 8
- Chromedriver helper downloading weird chromedriver version number HOT 2
- NameError: uninitialized constant Chromedriver in rails & rspec config HOT 5
- Mention "require" in README? HOT 3
- certificate verify failed (self signed certificate in certificate chain) (OpenSSL::SSL::SSLError) HOT 9
- Not executable: chromedriver-helper HOT 1
- No output with 'which chromedriver' after installing 2.1.0 HOT 3
- Not working in rspec (calling in rails_helper.rb) HOT 1
- Can't get this working in trivial case HOT 7
- Allow setting an environment variable to skip installation, for systems on which a compatible chromedriver is already installed HOT 11
- Use a compatible version of chromedriver HOT 8
- Version selection with LATEST_RELEASE is deprecated HOT 17
- Seeking new maintainer HOT 16
- Doc question HOT 1
- NOTICE: Ending support for this gem HOT 15
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 chromedriver-helper.