Install a previous version of chromedriver with brew - selenium-chromedriver

I want to install chromedriver version 79.0.3945.36 with brew. When I try to run
brew cask install chromedriver#79.0.3945.36
It fails saying chromedriver#79.0.3945.36 is unavailable: No Cask with this name exists.

I did a quick check, did not find cask formula has versioned ones.
The hack way of installing a old version of cask formula would be:
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask, go the place where cask is referenced
git reset --hard c3c1b84b7a, this would effective set chromedriver to v79.0.3945.36
git checkout -b temp, checkout a new branch, which prevents brew auto-refresh your local master
brew install --cask chromedriver, this would install your desired version.
After that you can always do git checkout master and brew up to keep in sync with the latest master of homebrew-cask.
here is my installation log
==> Downloading https://chromedriver.storage.googleapis.com/79.0.3945.36/chromedriver_mac64.zip
Already downloaded: /Users/rchen/Library/Caches/Homebrew/downloads/2712e559b7e0712e196b123a7581adecc2cfdc8d8d728b01fd875b3d371e5d29--chromedriver_mac64.zip
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
🍺 chromedriver was successfully installed!
test log:
$ chromedriver --version
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945#{#614})

To build on #chenrui's answer, this is how I did it on an M1 mac (downgrade from 93 to 92). This should work on Intel too (via brew --prefix).
# Get commit which upgraded
cd "$(brew --prefix)/Library/Taps/homebrew/homebrew-cask/Casks"
git log chromedriver.rb
# Revert commit(s) which upgraded, eg ed35867f216512c9840756dce57e61f8eac26bb6
git revert ed35867f216512c9840756dce57e61f8eac26bb6
# Reinstall
brew reinstall chromedriver
# Pin version
brew pin chromedriver
# Resolve error: "chromedriver" cannot be opened because the developer cannot be verified.
xattr -d com.apple.quarantine "$(which chromedriver)"
# Later, when version no longer needs to be pinned
brew unpin chromedriver

I tried below and it worked!
Go to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks and edit the file named chromedriver.rb\
Update the required version of chromedriver in the 2nd line
(see - https://sites.google.com/chromium.org/driver/downloads for required version number)
From your terminal, run brew reinstall chromedriver
You will get error message stating the SHA is mismatching with expected and actual values. Copy the actual value from your terminal and replace it in chromedriver.rb file
(Note: you may need to delete the downloaded chromedriver.zip file, follow the instruction/path location mentioned in the error message of your terminal to delete the file and then proceed to next step)
Run again brew reinstall chromedriver

Related

Brew install chromedriver not working?

I am using MacOS, when I tried to install chromedriver using homebrew
brew install chromedriver
I get:
Error: No available formula with the name "chromedriver"
It was migrated from homebrew/core to caskroom/cask.
You can access it again by running:
brew tap caskroom/cask
I typed brew tap caskroom/cask but chromedriver is still not installed.
Can someone please help me on this? Thanks!
Update: This answer has been outdated. Please follow the answer from #Chris, which is now the correct answer.
After tapping caskroom/cask by using brew tap caskroom/cask,
install chromedriver using brew cask install chromedriver.
You can see other commands using brew cask help.
Update: This answer has been outdated. Please follow the answer from #Nick Predey
You can install it by running:
brew tap homebrew/cask
brew cask install chromedriver
The previous answers using brew cask etc. did not work for me.
As of May 2021, the following worked for me using homebrew:
brew install chromedriver
Which is confirmed by:
==> Downloading https://chromedriver.storage.googleapis.com/90.0.4430.24/chromed
######################################################################## 100.0%
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'
🍺 chromedriver was successfully installed!
brew tap homebrew/cask && brew install --cask chromedriver
Worked for me
In case you get the following error:
Error: Cask chromedriver-beta exists in multiple taps:
homebrew/cask-versions/chromedriver-beta
caskroom/versions/chromedriver-beta
untap the other cask:
$ brew untap caskroom/versions
Then follow the #Chris' answer:
$ brew cask install chromedriver
Copy the below command and execute to download the latest script
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Install chromedriver using brew
brew cask install chromedriver
Be sure to checkout updates to brewinstall if the commands get changed in the feature.

Can't update chromedriver in macos10.12.6

I am trying to update chromedriver from 2.30 to 2.35. However, after I brew install chromedriver, the default chromedriver is still 2.30. If I redo brew, it will tell me I have already installed 2.35 version, but when I use chromedriver --version, it still shows 2.30. Can any one tell me why it's that? And can I know where does this brew install?
Thanks!
Output of brew list chromedriver:
/usr/local/Cellar/chromedriver/2.35/bin/chromedriver
/usr/local/Cellar/chromedriver/2.35/homebrew.mxcl.chromedriv‌​er.plist
and output of which chromedriver shows it's using version 2.30 in other path.
I had the same problem and was able to fix it by:
brew uninstall chromedriver
then I did
brew info chromedriver
which told me to do:
brew tap homebrew/cask
brew cask install chromedriver
It installed chromedriver 2.40
brew cask reinstall chromedriver
In my case helped just reinstalling chromedriver
Example output:
==> Satisfying dependencies
==> Downloading https://chromedriver.storage.googleapis.com/75.0.3770.90/chromedriver_mac64.zip
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Uninstalling Cask chromedriver
==> Unlinking Binary '/usr/local/bin/chromedriver'.
==> Purging files for version 2.45 of Cask chromedriver
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
🍺 chromedriver was successfully installed!
Install or reinstall it using:
brew cask install chromedriver
When you need to update it, use:
brew cask upgrade chromedriver
Fileland :perform below steps please
Go to usr/local/bin folder if you are admin to your machine
Trash the existing chrmodriver exe file
Go to terminal and hit the command brew cask reinstall chromedriver
check the version on the same terminal using the command chromdriver --version.
The new version of the command to upgrade chromedriver is the following:
brew upgrade --cask chromedriver
If you receive the error:
“chromedriver” cannot be opened because the developer cannot be verified.
You need to put it outside the quarantine with:
xattr -r -d com.apple.quarantine /usr/local/bin/chromedriver
Download the 2.35 archive and unzip
Place the standalone executable chromedriver wherever you like
Add that location to the PATH variable by adding the following line to your .bash_profile file:
export PATH="/Users/location/of/chromedriver:$PATH"
For OSX Catalina 10.15.6:
brew upgrade chromedriver

I attempted to enable the EPEL repo on my Fedora 22 machine and I broke it, now errors are thrown

I made the attempt at enabling EPEL on my Fedora 22 machine by running
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Then
sudo rpm -ivh epel-release-7-5.noarch.rpm
And now when I run
dnf repolist
I get the following
[sinux1#horrible-host ~]$ sudo dnf repolist
Extra Packages for Enterprise Linux 7 - x86_64 1.8 MB/s | 9.0 MB 00:05
Failed to open: /var/cache/dnf/epel-2b6dfc5904c26562/repodata/49c4e3bd54f19136521be9b254830c954369cc22ce1b661db502ebef13b0004c-updateinfo.xml.bz2.
[sinux1#horrible-host ~]$
I'm stuck and not sure what my next step is. How can I reverse what I did, and what would have been the proper way of enabling EPEL?
Thanks for any input
This is what appears to have worked for me.
Remove the epel repo
rm -rf /etc/yum.repos.d/epel*
then try install epel via dnf
dnf clean all
dnf install epel-release
I did the same as Sinux Tine and ended up in some sort of deadlock.
First try to do like Rup says.
If everything fails, try the following as a last resort. It worked for me.
> su
> cd /var/cache/dnf/epel-2b6dfc5904c26562/repodata
> mkdir throwaway
> mv 49c4e3bd54f19136521be9b254830c954369cc22ce1b661db502ebef13b0004c-updateinfo.xml.bz2 throwaway
That effectively deletes the file which dnf says it cannot open.
When and if the problem is solved, you can delete the throwaway directory and its contents.
Current libsolv version does not have bz2 compression.
Solution: enable bunzip2 compression in libsolv, Basically 'yum update libsolv', then reinstall epel-release.
To complement the answer for Centos 7, I followed the next steps:
Download the libsolv-0.6.14-1.el7 wich was patched
Install it
sudo rpm -ivh libsolv-0.6.14-1.el7.centos.x86_64.rpm
If we get a conflict with the previous version
warning: libsolv-0.6.14-1.el7.centos.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 1b6f9f55: NOKEY
Preparing... ################################# [100%]
file /usr/lib64/libsolv.so.0 from install of libsolv-0.6.14-1.el7.centos.x86_64 conflicts with file from package libsolv-0.6.11-1.el7.x86_64
file /usr/lib64/libsolvext.so.0 from install of libsolv-0.6.14-1.el7.centos.x86_64 conflicts with file from package libsolv-0.6.11-1.el7.x86_64
We proceed to remove the previous version
sudo yum erase libsolv-0.6.11-1.el7.x86_64
and install the patched libsolv package
sudo rpm -ivh libsolv-0.6.14-1.el7.centos.x86_64.rpm
We need to reinstall the dnf package manager, because it was removed after to remove the libsolv so we install with the following command.
sudo yum install dnf
We validate it using sudo dnf repolist now it, give us the right output.
Using metadata from Mon Jun 13 10:53:11 2016
repo id repo name status
base CentOS-7 - Base 9,007

PHPAdmin on Redhat 6.4

I'm try into install the latest PhpMyAdmin into the Redhat 6.4 and I can't get it working and getting dependencies error, I'm try install through YUM REMI and other file repo, all I can get it working is the old version 2.11 which is very old.
I manually downloaded the Phpadmin 4.xx. RPM and using Yum localinstall and still not working.
The box is running PHP 5.6.9 and MySQL Server 5.6.22-log
Anyone have any idea?
Usually it gets to work if we do the following as preliminary steps
Firstly clean your metadata: This cleans up any xml metadata that may have been cached from any enabled repository
$ sudo yum clean metadata
Then upgrade all of your system software to the latest version
$ sudo yum update
But, if you have installed PHP 5.6.9 from remi repository, then need to check the phpmyadmin version compatibility with php from remi repository. Do not downgrade php if there is a mismatch. In that case try this
yum --enablerepo=remi install phpmyadmin
If you get package not found
The EPEL repo contains the phpMyAdmin package we are looking for.
sudo yum install epel-release
Once EPEL is done try
sudo yum install phpmyadmin
For reference:
http://www.if-not-true-then-false.com/2012/install-phpmyadmin-on-fedora-centos-red-hat-rhel/
http://www.krizna.com/centos/how-install-phpmyadmin-centos-6/

Error while installing json gem 'mkmf.rb can't find header files for ruby'

For context, it on a remote server which has a firewall. I'm setting up my environment through a proxy. I have ruby 1.8.7. When I try to gem install..
sudo gem install --http-proxy <host address>:<port> json
I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
Since I was unsure what the problem is, I googled and found these
gem install: Failed to build gem native extension (can't find header files) - the instructions here seem to be specific to the gem being installed.
How to install json gem - Failed to build gem native extension This seems to be slightly different error.
Any hints? Thanks!
Modern era update, as stated by mimoralea:
In case that you are using ruby 2.0 or 2.2 (thanks #patrick-davey).
sudo apt-get install ruby2.0-dev
sudo apt-get install ruby2.2-dev
sudo apt-get install ruby2.3-dev
or, generic way:
sudo apt-get install ruby-dev
or
sudo apt-get install ruby`ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]'`-dev
The first link you’ve posted is exactly your case: there is no ruby development environment installed. Development env is needed to compile ruby extensions, which are mostly written in C. Proxy has nothing to do with the problem: everything is downloaded fine, just compilation fails.
I would suggest you to install ruby-dev (ruby-devel for rpm-based distros) package onto you target machine.
gcc package might be needed as well.
Try:
$ sudo apt-get install ruby-dev
Or, for Redhat distro:
$ sudo yum install ruby-devel
Or, for [open]SuSE:
$ sudo zypper install ruby-devel
For Xcode 11 on macOS 10.14, this can happen even after installing Xcode and installing command-line tools and accepting the license with
sudo xcode-select --install
sudo xcodebuild -license accept
The issue is that Xcode 11 ships the macOS 10.15 SDK which includes headers for ruby2.6, but not for macOS 10.14's ruby2.3. You can verify that this is your problem by running
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
which on macOS 10.14 with Xcode 11 prints the non-existent path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
However, Xcode 11 installs a macOS 10.14 SDK within /Library/Developer/CommandLineTools/SDKs/MacOS10.14.sdk. It isn't necessary to pollute the system directories by installing the old header files as suggested in other answers. Instead, by selecting that SDK, the appropriate ruby2.3 headers will be found:
sudo xcode-select --switch /Library/Developer/CommandLineTools
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
This should now correctly print
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
Likewise, gem install should work while that SDK is selected.
To switch back to the current Xcode SDK, use
sudo xcode-select --switch /Applications/Xcode.app
In case that you are using ruby 2.0 or 2.2 (thanks #patrick-davey) or 2.3 (thanks #juanitofatas).
sudo apt-get install ruby-dev
sudo apt-get install ruby2.0-dev
sudo apt-get install ruby2.2-dev
sudo apt-get install ruby2.3-dev
And you get the pattern here...
I also encountered this problem because I install Ruby on Ubuntu via brightbox, and I thought ruby-dev is the trunk of ruby. So I did not install. Install ruby2.3-dev fixes it:
sudo apt-get install ruby2.3-dev
For those who are getting this on Mac OS X you may need to run the following command to install the XCode command-line tools, even if you already have XCode installed:
sudo xcode-select --install
Also you must agree the terms and conditions of XCode by running the following command:
sudo xcodebuild -license
I had a similar problem using cygwin to run the following command:
$ gem install rerun
I solved it by installing the following cygwin packages:
ruby-devel
libffi-devel
gcc-core
gcc-g++
make
automake1.15
Most voted solution didn't work on my machine (linux mint 18.04).
After a careful look, i found that g++ was missing.
Solved with
sudo apt-get install g++
in case you use SUSE
sudo yast2 -i ruby-devel
Xcode 11 / macOS Catalina
On Xcode 11 / macOS Catalina, the header files are no longer in the old location and the old /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg file is no longer available.
Instead, the headers are now installed to the /usr/include directory of the current SDK path:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
Most of this directory can be found by using the output of xcrun --show-sdk-path. And if you add this path to the CPATH environment variable, then build scripts (including those called via bundle) will generally be able to find it.
I resolved this by setting my CPATH in my .zshrc file:
export CPATH="$(xcrun --show-sdk-path)/usr/include"
After opening a new shell (or running source .zshrc), I no longer receive the error message mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h and the rubygems install properly.
Note on Building to Non-macOS Platforms
If you are building to non-macOS platforms, such as iOS/tvOS/watchOS, this change will attempt to include the macOS SDK in those platforms, causing build errors. To resolve, either don't set CPATH environment variable on login, or temporarily set it to blank when running xcodebuild like so:
CPATH="" xcodebuild --some-args
In Fedora 21 and up, you simply open a terminal and install the Ruby Development files as root.
dnf install ruby-devel
On Mac 10.14, the header files don't seem to be installed in the correct place. Rather than changing paths like the other fixes, I was able to just run this:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Follow the instructions and it resolved this problem for me.
You may need to install gcc after install ruby-devel
Xcode -> Preferences -> Locations
change Command Line Tools to Xcode 11.2.1
You need to install the entire ruby and not just the minimum package. The correct command to use is:
sudo apt install ruby-full
The following command will also not install a complete ruby:
sudo apt-get install ruby2.3-dev
For Ubuntu 18, after checking log file mentioned while install
Results logged to /var/canvas/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nio4r-2.5.2/gem_make.out
with
less /var/canvas/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nio4r-2.5.2/gem_make.out
I noticed that make is not found. So installed make by
sudo apt-get install make
everything worked.
I faced a similar issue on Xcode 12 with macOS 10.15 and cocoapods. Just make sure that the xcode-select command points to the SDK you want to build against. It should build without issues afterwards.
BEFORE you follow the tip from Joki's answer (below) and IF :
you have MacOS 10.14.6
at /Library/Developer/CommandLineTools/SDKs/ you have folders
MacOSX.sdk(symbolic), MacOSX10.14.sdk, MacOSX10.15.sdk
Move MacOSX10.15.sdk to anywhere (admin privileges needs)
Delete symbolic link (admin privileges needs)
At /Library/Developer/CommandLineTools/SDKs/ create another symbolic link now to MacOSX10.14.sdk folder using (admin privileges needs)
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk MacOSX.sdk
Now you can follow Joki's answer
WARNING!
If you move MacOSX10.15.sdk folder to /Library/Developer/CommandLineTools/SDKs/ again, the command
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
will show MacOSX10.15.sdk folder like default again, nowadays I dunno how to fix it! My suggestion, compress the folder and put the original folder until fix will be available.
macOS RubyMine Gem installation failure
My problem with this error message was when trying to install a Gem via RubyMine. It didn't like that I had changed the global Ruby version with rbenv, so I fixed it by changing back to the system default Ruby version with:
rbenv global system
and restarted RubyMine.
sudo apt-get --reinstall install ruby
try it for ubuntu 16.04