【问题标题】:Adding chromedriver to correct $PATH添加 chromedriver 以更正 $PATH
【发布时间】:2017-01-20 05:22:23
【问题描述】:

当我输入 echo $PATH 我得到:

/Users/myname/.rvm/gems/ruby-2.2.1/bin:/Users/myname/.rvm/gems/ruby-2.2.1@global/bin:/Users/myname/.rvm/rubies/ruby-2.2.1/bin:/Users/myname/.rvm/bin:/Users/myname/.rbenv/shims:/Users/myname/.rbenv/shims:/Users/myname/.rbenv/shims:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

当我尝试使用 chromedriver 时,我得到:

/Users/myname/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.49.0/lib/selenium/webdriver/chrome/service.rb:38:in 'executable_path': Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.

(我已经下载了chromedriver)。

我应该将我的 chromedriver.exec 文件放在哪里?我该怎么做? 我使用 RVM,所以这可能是正确路径中没有 chromedriver 的原因...

【问题讨论】:

    标签: ruby path rvm filepath selenium-chromedriver


    【解决方案1】:

    我不是 RVM 用户,所以我不能谈论它的细节,但通常你将 chromedriver 可执行文件保存在文件系统的某个位置。然后,您需要将该位置的文件路径添加到您的 PATH 变量中。在基于 UNIX 的系统上,您可以修改 shell 配置文件中的 PATH 变量。例如,使用 bash shell,您可能在 .profile 或 .bashrc 等中设置了一些东西 - 只是您在设置中碰巧使用的任何东西。如果您不熟悉编辑 PATH 变量,您可以从这里开始:https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path

    【讨论】:

    • 感谢您的回复,我会尽快调查。
    猜你喜欢
    • 2018-06-21
    • 2019-11-03
    • 2018-08-15
    • 1970-01-01
    • 1970-01-01
    • 2014-06-21
    • 2016-04-12
    • 2021-08-19
    • 2015-09-14
    相关资源
    最近更新 更多