ラベル Tech の投稿を表示しています。 すべての投稿を表示
ラベル Tech の投稿を表示しています。 すべての投稿を表示

2012/09/02

[CI]JavascriptのUnitテストをスケジューリング(Jenkins,phantomjs,qunit)

JavascriptのUnitテストをJenkinsで定期的に実施することを目標にやってみました。
今回はAWSのEC2(Amazon Linux AMI 2012.03 64bit)をCIサーバとして利用してます。

QUnitを下記からダウンロード(画面右側のqunit-1.9.0.js,qunit-1.9.0.cssの2ファイル )
http://qunitjs.com/

使い方としてはテストするwebページに上記2つのファイルと、作成したテストコードのjsファイルを読み込みます。あとは<div id="qunit"></div>をBody内に用意すればQUnitのテスト結果が表示されます。※QUnitの使い方は本家や他サイトを参考にしてください。

ただこれではブラウザでwebページを表示しなければテストができないので、Jenkinsに設定できません。なのでコマンドから実行するためにphantomjsを使用します。
phantomjsはWebkitベースでコマンドからJavascriptが実行できるツールです。
今回の環境では下記のLinux(For64bit)を設置するだけで問題なく利用できました。(phantomjs version1.6.1)
http://phantomjs.org/download.html

※別サーバのCentOSでも試してみましたが上記では動作せず、qt47webkitをインストールした後、下記手順でインストールしました。(phantomjs version1.5.0)
http://phantomjs.org/build.html

phantomjsでQUnitのテストを実施するには下記ファイルを利用します。
phantomjs/examples/run-qunit.js
※この中にTimeout間での時間や再実行のための時間などが設定されています。起動に時間がかかる場合はこのファイルを適せん変更してください。

下記コマンドを実行することでQUnitのテストが実施できます。
$ phantomjs run-qunit.js http://dummy.com/test.html

結果は下記用のような感じ(6つのテストを実施してすべて成功)

'waitFor()' finished in 201ms.
Tests completed in 27 milliseconds.
6 tests of 6 passed, 0 failed.


※phantomjsコマンドの第1引数はWebページを起動する前に読み込ませるJsファイルが指定できます。(http経由ではエラーとなりました。。)

後はJenkinsに登録すればOKです。

1.新規ジョブ作成から下記画面の設定で「OK」ボタンクリック



2.作成したジョブから「設定」で「ビルド手順の追加」から「シェルの実行」をクリック


3.phantomjsのコマンドを設定し保存



これでビルド実行でテストが実施されます。テストが問題なければjenkins側でも成功として表示されます。



2012/07/25

[CI]Seleniumの導入方法

1.FirefoxにSelenium IDEをインストール







2.このサイトからはFirefoxにソフトウェアをインストールできない設定になっています」と表示されたら「許可」を選択





3.「作者を信頼しているアドオン以外はインストールしないでください」と表示されたら「今すぐインストール」をクリック





4.FireFoxを再起動し、ツールタブからインストールされていることを確認






5.Selenium Client Drivers(Java)をダウンロードする
http://seleniumhq.org/download/





6.ダウンロードしたファイルを解凍




7.eclipseを起動してJavaプロジェクトを作成



8.作ったJavaプロジェクトのBuildパスに先ほど解凍したファイルを追加
(selenium-java-2.x.x.jar と libsフォルダ以下のすべてのjarファイル。selenium-java-2.x.x.-srcsjarは不要)




ここまでで導入手順は完了です。

使い方の流れとしてはFirefoxのSeleniumIDEでテストケースを作成した後、実行ファイルをエクポートして、Eclipseにインポートし、Eclipse上からテストを実施します。


1.Firefoxを起動して、ツールからSelenium IDE を選択
2.Selenium IDEは起動すると記録状態になっているので、そのまま画面操作(テスト)を開始します
3.画面操作が終了したらSelenium IDEウィンドウ右上の赤丸をクリックして記録を停止します
4.Selenium IDEウィンドウで ファイル → テストケースをエクスポート → JUniu4(WebDriver) を選択して、名前を付けて保存します
5.Eclipseからファイル → インポート → 一般 → ファイル・システムを選択
6.Selenium IDEでエクスポートしたファイル、インポートします
7.インポートしたファイルを選択し、右クリックからRun As→JUnitTestをクリック

これでFirefoxが起動し記録したテスト操作が行われます

またSeleniumのダウンロードサイトからIE,Chrome版のWebdriverをダウンロードして
コードのimportに下記を追加

import org.openqa.selenium.firefox.FirefoxDriver;

import org.openqa.selenium.ie.InternetExplorerDriver;


で、下記箇所をダウンロードしたWebdriverに変更する事でIE,Chromeのテストコードも作成できます
driver = new FirefoxDriver();


System.setProperty("webdriver.ie.driver", "C:\\selenium\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver.exe");
driver = new ChromeDriver();





2012/07/04

Twitterの各種制限文字数


忘れないうちに書いとこ。

名前(name)
→全半角20文字

ユーザ名(screen_name)
→半角15文字

つぶやき(text)
→全半角140文字

自己紹介(description)
→全半角160文字

FaceBookのRSSフィードスクレイピング



サーバからphpのfile_get_contentsを使って、
フィード情報を取得しようとしたら
「互換性のないブラウザ」
なんていうHTMLのデータが取得されてきた。
しょうがないからUserAgentにFireFoxのデータをぶち込むことで
フィードのXMLデータが取得できた。

$ua="User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\r\n";
$options = array('http' => array('method' => 'GET','header' => $ua));
$feed_str = file_get_contents("facebook_rss", false, stream_context_create($options));

一安心かと思いきやSJISにエンコードした際に、意味不明な文字化けが発生。
何かと思い文字コードを確認してみると”C2A0″ってコードが悪さしており
調べてみるとUTF8の半角スペースで、エンコードで失敗してしまう。
しょうがないので事前にソース上で変換する事で解決できた。

str_replace( "\xc2\xa0", " ", description);

やり方あってる?


xAuthの申請


下記文面を土曜の23時ごろに送ったら、火曜日の朝5時くらいに返事が来た。

■送信文面
サポート窓口 様
お世話になっております。
Apacheのcrontabを使用して、定期的にtweetを行うため
xAuthを利用したく、xAuthの利用許諾をお願いいたします。
今回の目的としては、~ Tweetします。
1) アカウントの情報
ID:ユーザID
2)アプリケーションのOAuthリンク
http://~サイト名~
3)デベロッパーページ
Twitterアプリの管理ページ(https://dev.twitter.com/apps/数値)
===================================================
Dear Sirs
上記を英訳したもの

1) Application Info:
ID:ユーザID
2) Application’s OAuth link:
~サイト名~
3) Developer Page:
Twitterアプリの管理ページ(https://dev.twitter.com/apps/数値)
Best Regards

■返事
Hello,
Thank you for writing in.
Your application now has the ability to use xAuth,
and our documentation is available
here: http://dev.twitter.com/pages/xauth .
Thanks,
Twitter API Policy

2012/07/03

[Heroku]環境構築(windows7) sec.4 - Herokuへのデプロイ


・railsアプリの作成(今回はdummypjというプロジェクトをDドライブ直下に作成)
コマンドプロンプトにて下記コマンドを入力
rails new dummypj

d:\>rails new dummypj
      create
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.gitkeep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bundler (1.1.4)
Installing coffee-script-source (1.3.3)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.3)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.0.2)
Using rails (3.2.6)
Installing sass (3.1.20)
Installing sass-rails (3.2.5)
Installing sqlite3 (1.3.6)
Installing uglifier (1.2.6)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

d:\>


D:\dummypj\config\routes.rbの最下行に下記を追記
root :to => "products#index"


D:\dummypj\Gemfileのsqlite3に関する部分を修正
8行目周辺の「gem 'sqlite3'」を削除し下記を追記
(herokuではsqlite3のコンパイルでエラーとなるので開発環境のみで利用。
また本番デプロイ時にproductionの部分は自動的に書き換えられるためなくてもよい)
group :production do
  gem 'pg'
  gem 'therubyracer-heroku'
end
group :development, :test do
  gem 'sqlite3'
end


下記コマンドを実施
bundle --without production
(therubyracer-herokuでエラーとなるため。herokuにpushしたタイミングでheroku側でbundle installが走るのでローカルの確認では不要)
bundle exec rake assets:precompile RAILS_ENV=production(本番環境でRakeタスクを直接実行し、プリコンパイル済みのアセットを作成する やらないとエラーとなった)


D:\dummypj\config\environments\production.rb
falseからtrueに変更(18行目らへん)
# Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true


ここからがデプロイ準備作業(下記コマンドを実施)
git init
git add .
git commit -m "New Create"
heroku create
git push heroku master
heroku open

ブラウザが起動し下記画面が表示されたら成功



※Gitのインストール後、鍵生成の作業が必要。参考サイトは下記
http://blog.infinity-dimensions.com/2012/01/git-gui-create-public-key.html


またデプロイ手順はこちらを参考にしました。
http://d.hatena.ne.jp/language_and_engineering/20110914/p1



[Heroku]環境構築(windows7) sec.1 - rubyのインストール
[Heroku]環境構築(windows7) sec.2 - 必要ファイルの更新
[Heroku]環境構築(windows7) sec.3 - Herokuの登録、gitのインストール
[Heroku]環境構築(windows7) sec.4 - Herokuへのデプロイ

2012/07/02

[Heroku]環境構築(windows7) sec.3 - Herokuの登録、gitのインストール

下記サイトでサインアップを行い手順に従ってherokuアカウントの登録を行う
https://api.heroku.com/signup



下記サイトからGitをダウンロードしexeを起動
http://code.google.com/p/msysgit/downloads/list



基本的にはそのまま「Next」でOKだが下記の画面でラジオボタンの変更を行う





全て終わったらコマンドプロンプトを起動し下記コマンド入力で動作確認

C:\>git --version
git version 1.7.11.msysgit.0

heroku関連のgemをコマンドプロンプトから下記2コマンドでインストール開始
gem search -r heroku
gem install heroku bundler



[Heroku]環境構築(windows7) sec.1 - rubyのインストール
[Heroku]環境構築(windows7) sec.2 - 必要ファイルの更新
[Heroku]環境構築(windows7) sec.3 - Herokuの登録、gitのインストール
[Heroku]環境構築(windows7) sec.4 - Herokuへのデプロイ

2012/07/01

[RubyonRails3]rmagickのインストール for windows7




rmagickのインストールでハマりました。

利用するにはimagemagickのインストールも必要
http://www.imagemagick.org/script/binary-releases.php#windows

ここで「ImageMagick-6.7.8-0-Q16-windows-dll.exe」をダウンロードしてインストール。(僕のPCは64bit)


インストールでは基本デフォルトのままでよいがSelectAdditionalTask画面(チェックボックスが6個ある画面)では下記3つを選択。
・Create a desktop icon
・Add application directory to your system path
・Install development headers and libraries for C and C++






インストール後は一度PCを再起動してコマンドプロンプトでconvert --versionで下記メッセージを確認※うまく動作しない場合は環境変数にインストール先のパスが指定されているかチェック。

Version: ImageMagick 6.7.8-0 2012-06-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

その後、
gem install rmagick
を行うと下記エラーが出てきた。

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        C:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby192/bin/ruby
C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header'
        from extconf.rb:193:in `<main>'


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out


オプションを利用してimagemagickのパスを指定することでエラーが出なくなった。
gem install rmagick -v '2.13.1' -- '--platform=ruby --with-opt-lib="C:\Program Files (x86)\ImageMagick-6.7.8-Q16\lib" --with-opt-include="C:\Program Files (x86)\ImageMagick-6.7.8-Q16\include"'

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...

ちなみに僕の環境のバージョン
>ruby --version
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

>rails --version
Rails 3.1.3


2012/06/30

[heroku]稼動/障害状況の確認

herokuで作成したWebアプリ等が動作しない場合は下記でheroku自体の稼動/障害状況を確認できます。
https://status.heroku.com/


ちなみに今日は2時間以上落ちてる orz=3

2012/06/29

[RubyonRails3]コントローラーからテンプレートの呼び出し


基本的には不要です。

コントローラーと同名のテンプレートファイル(***.html.erb)をlayoutフォルダに配置しておけば自動的に読み込まれます。

また特定のlayoutファイルを利用したい場合は下記のようなコードを記述します。

layout "***(コントローラー名)"

[RubyonRails3]初回起動時、jqueryの読み込みエラー Sprockets::FileNotFound in


僕の環境だけなのかもしれませんが、viewを利用して画面表示を行った際に
下記のようなエラーとなりました。

Sprockets::FileNotFound in クラス名#アクション名
Showing c:/railscode/test_app/app/views/layouts/application.html.erb
where line #6 raised:

couldn't find file 'jquery'




簡単な解消方法としては
/app/assets/javascripts/application.js
の下記部分を削除すればエラーがなくなります。

//= require jquery
//= require jquery_ujs

jqueryを利用するのであれば
/app/assets/javascripts/
にファイルを配置する事でOKです。

[Heroku]環境構築(windows7) sec.2 - 必要ファイルの更新

コマンドプロンプトを起動して下記コマンドを実行


・Rubyのインストールフォルダに移動
cd C:\Ruby193

・RubyGems の更新
gem install rubygems-update
update_rubygems

・rspec, rspec-rails, gitのインストール
gem update
gem install rspec
gem install rspec-rails
gem install git

・Ruby on Railsのインストール
gem install pkg-config
gem install rails


■コマンド実行時のログ


c:\Ruby193>gem install rubygems-update
Fetching: rubygems-update-1.8.24.gem (100%)
Successfully installed rubygems-update-1.8.24
1 gem installed
Installing ri documentation for rubygems-update-1.8.24...
unable to convert U+0160 from UTF-8 to Windows-31J for History.txt, skipping
Installing RDoc documentation for rubygems-update-1.8.24...
unable to convert U+0160 from UTF-8 to Windows-31J for History.txt, skipping

c:\Ruby193>update_rubygems
RubyGems 1.8.24 installed
unable to convert U+0160 from UTF-8 to Windows-31J for History.txt, skipping
unable to convert U+0160 from UTF-8 to Windows-31J for History.txt, skipping

== 1.8.24 / 2012-04-27

* 1 bug fix:

  * Install the .pem files properly. Fixes #320
  * Remove OpenSSL dependency from the http code path


------------------------------------------------------------------------------

RubyGems installed the following executables:
        C:/Ruby193/bin/gem


c:\Ruby193>gem update
Updating installed gems
Updating json
Fetching: json-1.7.3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.7.3
Updating minitest
Fetching: minitest-3.2.0.gem (100%)
Successfully installed minitest-3.2.0
Updating rdoc
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-3.12
Gems updated: json, minitest, rdoc
Installing ri documentation for json-1.7.3...
Installing ri documentation for minitest-3.2.0...
Installing ri documentation for rdoc-3.12...
unable to convert U+00A9 from UTF-8 to Windows-31J for lib/rdoc/text.rb, skipping
unable to convert "\xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for History.rdoc, skipping
Installing RDoc documentation for json-1.7.3...
Installing RDoc documentation for minitest-3.2.0...
Installing RDoc documentation for rdoc-3.12...
unable to convert U+00A9 from UTF-8 to Windows-31J for lib/rdoc/text.rb, skipping
unable to convert "\xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for History.rdoc, skipping

c:\Ruby193>gem install rspec
Fetching: rspec-core-2.10.1.gem (100%)
Fetching: diff-lcs-1.1.3.gem (100%)
Fetching: rspec-expectations-2.10.0.gem (100%)
Fetching: rspec-mocks-2.10.1.gem (100%)
Fetching: rspec-2.10.0.gem (100%)
Successfully installed rspec-core-2.10.1
Successfully installed diff-lcs-1.1.3
Successfully installed rspec-expectations-2.10.0
Successfully installed rspec-mocks-2.10.1
Successfully installed rspec-2.10.0
5 gems installed
Installing ri documentation for rspec-core-2.10.1...
Installing ri documentation for diff-lcs-1.1.3...
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for License.rdoc, skipping
Installing ri documentation for rspec-expectations-2.10.0...
Installing ri documentation for rspec-mocks-2.10.1...
Installing ri documentation for rspec-2.10.0...
Installing RDoc documentation for rspec-core-2.10.1...
Installing RDoc documentation for diff-lcs-1.1.3...
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for License.rdoc, skipping
Installing RDoc documentation for rspec-expectations-2.10.0...
Installing RDoc documentation for rspec-mocks-2.10.1...
Installing RDoc documentation for rspec-2.10.0...

c:\Ruby193>gem install rspec-rails
Fetching: i18n-0.6.0.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.6.gem (100%)
Fetching: builder-3.0.0.gem (100%)
Fetching: activemodel-3.2.6.gem (100%)
Fetching: rack-1.4.1.gem (100%)
Fetching: rack-cache-1.2.gem (100%)
Fetching: rack-test-0.6.1.gem (100%)
Fetching: journey-1.0.4.gem (100%)
Fetching: hike-1.2.1.gem (100%)
Fetching: tilt-1.3.3.gem (100%)
Fetching: sprockets-2.1.3.gem (100%)
Fetching: erubis-2.7.0.gem (100%)
Fetching: actionpack-3.2.6.gem (100%)
Fetching: rack-ssl-1.3.2.gem (100%)
Fetching: thor-0.15.4.gem (100%)
Fetching: railties-3.2.6.gem (100%)
Fetching: rspec-rails-2.10.1.gem (100%)
Successfully installed i18n-0.6.0
Successfully installed multi_json-1.3.6
Successfully installed activesupport-3.2.6
Successfully installed builder-3.0.0
Successfully installed activemodel-3.2.6
Successfully installed rack-1.4.1
Successfully installed rack-cache-1.2
Successfully installed rack-test-0.6.1
Successfully installed journey-1.0.4
Successfully installed hike-1.2.1
Successfully installed tilt-1.3.3
Successfully installed sprockets-2.1.3
Successfully installed erubis-2.7.0
Successfully installed actionpack-3.2.6
Successfully installed rack-ssl-1.3.2
Successfully installed thor-0.15.4
Successfully installed railties-3.2.6
Successfully installed rspec-rails-2.10.1
18 gems installed
Installing ri documentation for i18n-0.6.0...
unable to convert U+00C0 from UTF-8 to Windows-31J for lib/i18n/backend/transliterator.rb, skipping
unable to convert U+00E4 from UTF-8 to Windows-31J for lib/i18n/tests/interpolation.rb, skipping
unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for lib/i18n.rb, skipping
Installing ri documentation for multi_json-1.3.6...
Installing ri documentation for activesupport-3.2.6...
Installing ri documentation for builder-3.0.0...
Installing ri documentation for activemodel-3.2.6...
Installing ri documentation for rack-1.4.1...
Installing ri documentation for rack-cache-1.2...
Installing ri documentation for rack-test-0.6.1...
Installing ri documentation for journey-1.0.4...
Installing ri documentation for hike-1.2.1...
Installing ri documentation for tilt-1.3.3...
Installing ri documentation for sprockets-2.1.3...
Installing ri documentation for erubis-2.7.0...
Installing ri documentation for actionpack-3.2.6...
Installing ri documentation for rack-ssl-1.3.2...
Installing ri documentation for thor-0.15.4...
Installing ri documentation for railties-3.2.6...
Installing ri documentation for rspec-rails-2.10.1...
Installing RDoc documentation for i18n-0.6.0...
unable to convert U+00C0 from UTF-8 to Windows-31J for lib/i18n/backend/transliterator.rb, skipping
unable to convert U+00E4 from UTF-8 to Windows-31J for lib/i18n/tests/interpolation.rb, skipping
unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for lib/i18n.rb, skipping
Installing RDoc documentation for multi_json-1.3.6...
Installing RDoc documentation for activesupport-3.2.6...
Installing RDoc documentation for builder-3.0.0...
Installing RDoc documentation for activemodel-3.2.6...
Installing RDoc documentation for rack-1.4.1...
Installing RDoc documentation for rack-cache-1.2...
Installing RDoc documentation for rack-test-0.6.1...
Installing RDoc documentation for journey-1.0.4...
Installing RDoc documentation for hike-1.2.1...
Installing RDoc documentation for tilt-1.3.3...
Installing RDoc documentation for sprockets-2.1.3...
Installing RDoc documentation for erubis-2.7.0...
Installing RDoc documentation for actionpack-3.2.6...
Installing RDoc documentation for rack-ssl-1.3.2...
Installing RDoc documentation for thor-0.15.4...
Installing RDoc documentation for railties-3.2.6...
Installing RDoc documentation for rspec-rails-2.10.1...

c:\Ruby193>gem install git
Fetching: git-1.2.5.gem (100%)
Successfully installed git-1.2.5
1 gem installed
Installing ri documentation for git-1.2.5...
Installing RDoc documentation for git-1.2.5...

c:\Ruby193>gem install pkg-config
Fetching: pkg-config-1.1.3.gem (100%)
Successfully installed pkg-config-1.1.3
1 gem installed
Installing ri documentation for pkg-config-1.1.3...
Installing RDoc documentation for pkg-config-1.1.3...

c:\Ruby193>gem install rails
Fetching: arel-3.0.2.gem (100%)
Fetching: tzinfo-0.3.33.gem (100%)
Fetching: activerecord-3.2.6.gem (100%)
Fetching: activeresource-3.2.6.gem (100%)
Fetching: mime-types-1.19.gem (100%)
Fetching: polyglot-0.3.3.gem (100%)
Fetching: treetop-1.4.10.gem (100%)
Fetching: mail-2.4.4.gem (100%)
Fetching: actionmailer-3.2.6.gem (100%)
Fetching: bundler-1.1.4.gem (100%)
Fetching: rails-3.2.6.gem (100%)
Successfully installed arel-3.0.2
Successfully installed tzinfo-0.3.33
Successfully installed activerecord-3.2.6
Successfully installed activeresource-3.2.6
Successfully installed mime-types-1.19
Successfully installed polyglot-0.3.3
Successfully installed treetop-1.4.10
Successfully installed mail-2.4.4
Successfully installed actionmailer-3.2.6
Successfully installed bundler-1.1.4
Successfully installed rails-3.2.6
11 gems installed
Installing ri documentation for arel-3.0.2...
Installing ri documentation for tzinfo-0.3.33...
Installing ri documentation for activerecord-3.2.6...
Installing ri documentation for activeresource-3.2.6...
Installing ri documentation for mime-types-1.19...
unable to convert U+2013 from UTF-8 to Windows-31J for lib/mime/types.rb, skipping
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for Licence.rdoc, skipping
Installing ri documentation for polyglot-0.3.3...
Installing ri documentation for treetop-1.4.10...
Installing ri documentation for mail-2.4.4...
unable to convert U+00E9 from UTF-8 to Windows-31J for lib/mail/multibyte/chars.rb, skipping
Installing ri documentation for actionmailer-3.2.6...
Installing ri documentation for bundler-1.1.4...
Installing ri documentation for rails-3.2.6...
Installing RDoc documentation for arel-3.0.2...
Installing RDoc documentation for tzinfo-0.3.33...
Installing RDoc documentation for activerecord-3.2.6...
Installing RDoc documentation for activeresource-3.2.6...
Installing RDoc documentation for mime-types-1.19...
unable to convert U+2013 from UTF-8 to Windows-31J for lib/mime/types.rb, skipping
unable to convert "\xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for Licence.rdoc, skipping
Installing RDoc documentation for polyglot-0.3.3...
Installing RDoc documentation for treetop-1.4.10...
Installing RDoc documentation for mail-2.4.4...
unable to convert U+00E9 from UTF-8 to Windows-31J for lib/mail/multibyte/chars.rb, skipping
Installing RDoc documentation for actionmailer-3.2.6...
Installing RDoc documentation for bundler-1.1.4...
Installing RDoc documentation for rails-3.2.6...

c:\Ruby193>


●下記サイトを参考にしました
http://www.kkaneko.com/rinkou/ruby/rubyinstaller.html


[Heroku]環境構築(windows7) sec.1 - rubyのインストール
[Heroku]環境構築(windows7) sec.2 - 必要ファイルの更新
[Heroku]環境構築(windows7) sec.3 - Herokuの登録、gitのインストール
[Heroku]環境構築(windows7) sec.4 - Herokuへのデプロイ

[Heroku]環境構築(windows7) sec.1 - rubyのインストール


■下記ページでrubyのインストーラーとDevKitをダウンロード
http://rubyinstaller.org/





■rubyのインストール




インストール先のパスはcドライブの直下
Add Ruby executables to your PATHにチェック




■DevKitのインストール
ダウンロードしたexeファイル(例:DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe)を起動すると
ファイルが展開される(後でファイル移動するので、新規フォルダを作ってその中で起動するのがおすすめ)※展開すると下記イメージのような感じ


上記のすべてのファイルを「C:\Ruby193」rubyのインストール先に移動
( 下記イメージのような感じ )


コマンドプロンプトを起動し、下記コマンドを実行

cd C:\Ruby193

ruby dk.rb init
ruby dk.rb install


上記まで終わったら下記コマンドで動作確認
ruby --version

●下記サイトを参考にしました
http://www.kkaneko.com/rinkou/ruby/rubyinstaller.html


[Heroku]環境構築(windows7) sec.1 - rubyのインストール
[Heroku]環境構築(windows7) sec.2 - 必要ファイルの更新
[Heroku]環境構築(windows7) sec.3 - Herokuの登録、gitのインストール
[Heroku]環境構築(windows7) sec.4 - Herokuへのデプロイ