2014年5月23日

[訊真科技技術園地] 一些解決在mac osx 10.9遇到環境問題上的一些解決方式

最近自己在玩的watir,這裡有一些解決在mac osx 10.9遇到環境問題上的一些解決方式.




文章摘自: https://github.com/watir/watirbook/blob/master/installation/mac.md


Mac OS X 10.9

I> You will need internet access if you want to follow examples. All examples are tested with Mac OS X 10.9. All browsers are English (US) version.
Mac OS X 10.9 default desktop

Ruby

Good news is that Ruby is already installed by default. To check Ruby version, open Terminal application any type ruby -v. If you are not familiar with Terminal, see Command-line interface chapter.
You should get this:
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]

RubyGems

It is already installed, but an old version. Let's see which version is here with gem -v.
You should get this:
$ gem -v
2.0.3
Fortunately, it is easy to upgrade RubyGems with sudo gem update --system:
$ sudo gem update --system
(...)
RubyGems 2.1.11 installed
(...)

selenium-webdriver

Let's try selenium-webdriver gem. Install it with sudo gem install selenium-webdriver --no-ri --no-rdoc.
You will probably get this:
$ sudo gem install selenium-webdriver
(...)
Fetching: ffi-1.9.3.gem (100%)
Building native extensions.  This could take a
while...
ERROR:  Error installing selenium-webdriver:
ERROR: Failed to build gem native extension.
(...)
Fortunately, it is easy to fix. Install command line developer tools. To install them, type this into Terminal.
$ git --version
A popup will appear asking if you would like to install command line developer tools.
Install command line developer tools popup
Click Install. After the installation is finished, try again:
$ sudo gem install selenium-webdriver --no-ri
--no-rdoc
(...)
Successfully installed selenium-webdriver-2.37.0
(...)

更多文章請上 https://github.com/watir/watirbook/blob/master/installation/mac.md