rubyのスクレイピングライブラリmechanizeをインストール

rubyのスクレイピングライブラリmechanizeをインストール

rubyのスクレイピングライブラリmechanizeをインストールしましたので手順を記載しておきます。

mechanizeのインストール

bundlerを使用してmechanizeをインストールする場合

「Gemfile」を作成して以下を記載。

source "https://rubygems.org"
gem "mechanize"

bundlerからインストールする。

$ bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Installing unf_ext 0.0.7.2 (x64-mingw32)
Installing mime-types-data 3.2016.0521
Installing net-http-digest_auth 1.4.1
Installing net-http-persistent 2.9.4
Installing mini_portile2 2.1.0
Installing ntlm-http 0.1.1
Installing webrobots 0.1.2
Using bundler 1.14.4
Installing unf 0.1.4
Installing mime-types 3.1
Installing nokogiri 1.7.0.1 (x64-mingw32)
Installing domain_name 0.5.20161129
Installing http-cookie 1.0.3
Installing mechanize 2.7.5
Bundle complete! 1 Gemfile dependency, 14 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from nokogiri:
Nokogiri is built with the packaged libraries: libxml2-2.9.4, libxslt-1.1.29, zlib-1.2.8, libiconv-1.14.

これでGemfile.lockが生成されました。

Gemfile.lockの中身↓

GEM
 remote: https://rubygems.org/
 specs:
 domain_name (0.5.20161129)
 unf (>= 0.0.5, < 1.0.0)
 http-cookie (1.0.3)
 domain_name (~> 0.5)
 mechanize (2.7.5)
 domain_name (~> 0.5, >= 0.5.1)
 http-cookie (~> 1.0)
 mime-types (>= 1.17.2)
 net-http-digest_auth (~> 1.1, >= 1.1.1)
 net-http-persistent (~> 2.5, >= 2.5.2)
 nokogiri (~> 1.6)
 ntlm-http (~> 0.1, >= 0.1.1)
 webrobots (>= 0.0.9, < 0.2)
 mime-types (3.1)
 mime-types-data (~> 3.2015)
 mime-types-data (3.2016.0521)
 mini_portile2 (2.1.0)
 net-http-digest_auth (1.4.1)
 net-http-persistent (2.9.4)
 nokogiri (1.7.0.1-x64-mingw32)
 mini_portile2 (~> 2.1.0)
 ntlm-http (0.1.1)
 unf (0.1.4)
 unf_ext
 unf_ext (0.0.7.2-x64-mingw32)
 webrobots (0.1.2)

PLATFORMS
 x64-mingw32

DEPENDENCIES
 mechanize

BUNDLED WITH
 1.14.4

bundlerを使用しないでmechanizeをインストールする場合

$ gem install mechanize

Comments

No comments yet. Why don’t you start the discussion?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です