晴れ。27.0℃/17.6℃/53%
木曽の御嶽山は噴火中だってのに、関東は本当に穏やかな秋の一日だった。
金木犀の香りが二階の部屋まで忍び込んできていて、リラックスさせてくれる。
日曜日だというのに、慌ただしい一日だった。
午前中、両親が破壊した照明器具の、二部屋分交換作業を実施。
いまでは蛍光灯よりもLED照明が主流らしいけれど、8畳間に3800ルーメンの明かりが適切なのかどうか確証がないまま、パナソニック製の照明を買って取り付けてみた。これが大正解。いい塩梅とはまさにこのことと言わんばかりの、明るすぎず、暗くもなくという仕上がりに大満足。
午後はRailsのコードを書き、夕方はフィットネスクラブで身体を動かす。
クラブからの帰りに総菜屋によって晩ご飯のおかずを買い、簡単な夕食を済まして今に至る。
さてと、続きのコード書きをしないと。
$ rails generate model hoge hoge:sring
で作成したモデルは、次のコマンドで削除できる。
$ rails destroy model hoge
データベース上にテーブルを作ってしまった場合は、テーブル削除用のマイグレーションファイルを作成するよりも、とっととデータベースのコンソールを叩いてDropしてしまった方が早い。
今日のワンポイント。
Railsのフォーム画面とコントローラーについて備忘録
普通…と言い切って良いものか、Railsを学び始めた時は複数のコントローラーを使い分けることを意識していないと思う。というか、コントローラーが複数になるとどうなるのかと学習する前に挫折しているのかもしれないな。というのも、Railsでコントローラーを生成する際に、同時にいくつかのアクションも作ってしまうことが多いはず。app/views の下を覗くと、コントローラーの数だけフォルダが存在し、その中に生成したアクションに対応するビューが作られている。例えば、index.html.erbとか、show.html.erbとか。つまりコントローラーの数だけフォルダーとビューも作り分けられていて、Webの感覚だとhtdocsの下にいくつかディレクトリが切られ、そのなかで適宜htmlファイルが格納されている感じだ。
で、Railsの解説本は、最初はコントローラー1つで説明をする(もちろん読者を混乱させないようにするためなのだろうが)から、何でもかんでも1つのコントローラーに処理を書き込もうとして混乱し、挫折するんじゃないかという気がしてた。
僕もそんな感じで行き詰まっていたので、コントローラーを二つ作ってデータのやりとりしてみた。
適当な名前でプロジェクトを作り、コントローラーを2つ作る。
$ rails generate controller home index show
$ rails generate controller user show
homeにindexとshowが存在するのは、最初にhomeコントローラー内で完結する環境で実験を行ったため。本命は、home/index → user/show のコントローラー遷移とデータ表示だ。
1. config/routes.rb の設定
===ここから===
Rails.application.routes.draw do
get 'user/show'
post 'user/show'
get 'home/index'
post 'home/show'
get 'home/show'
# You can have the root of your site routed with "root"
root 'home#index'
end
===ここまで===
home/show環境でも実験したため、設定中に post 'home/show’ と get 'home/show' が残っているが、もちろん必要ない。
2. app/controllers 内の home_controller.rb と user_controller.rb の編集
home_controller.rbは次のように編集する。
===ここから===
class HomeController < ApplicationController
def index
end
def show
@msg=params[:contents]
end
end
===ここまで===
user_controller.rbは次のように編集する。
===ここから===
class UserController < ApplicationController
def show
@msg=params[:contents]
end
end
===ここまで===
home、userコントローラーでshowアクションが同じなので、ビューの設定でどちらのコントローラーでも実験が可能。
3. viewの編集 その1
app/views/home/index.html.erb を次のように編集する。
===ここから===
===ここまで===
form_tag(:controller =>"user", :action => "show") はsubmitボタンをクリックされたあと、コントローラーuserのshowアクションへ遷移しろという指定。:controller =>"user", のコントローラー指定がない場合は、コントローラーhome内のshowアクションへ遷移する。
また、入力フォームエリアが小さいと使いづらいので、サイズ変更をしている。
text_area_tag 'contents','', :size => "60x10"
リファレンスによると、text_area_tag(要素名 [, エリア配下のテキスト, オプション]) で、サイズ指定はオプション扱いなので「エリア配下のテキスト」が存在しない場合は必ず ,’’, を記述しておくこと。そうでないと、例えば , :size => "60x10" が初期値として書き込まれたフォームが表示される。
4. viewの編集 その2
app/views/user/show.html.erb を次のように編集する。
===ここから===
===ここまで===
app/views/home/index.html.erbで入力されたテキストは、こんな感じで app/controllers/user_controller.rb に引き渡されてくる。
Parameters: {"utf8"=>"✓", "authenticity_token"=>”なにやらお呪いなテキスト", "contents"=>"秋深し。\r\n隣りはなにをする人ぞ。\r\n>>javasvript\r\n<javascript>", "commit"=>"send"}
実際どうなるかはあとで説明するが、<html>などのタグを直接書き込めるようにしているとセキュリティホールになり得るので、危険性を取り除くためにサニタイズして表示させている。viewファイルの中で、<%= sanitize(simple_format(@msg)) %> と記述することでタグを除去している。
simple_formatは入力された文章をそのまま表示させるために必要。単純に<%= sanitize(@msg) %> とした場合、改行コードが働かずに表示される。
で、実際、こんな感じで動作する。
で、Railsの解説本は、最初はコントローラー1つで説明をする(もちろん読者を混乱させないようにするためなのだろうが)から、何でもかんでも1つのコントローラーに処理を書き込もうとして混乱し、挫折するんじゃないかという気がしてた。
僕もそんな感じで行き詰まっていたので、コントローラーを二つ作ってデータのやりとりしてみた。
適当な名前でプロジェクトを作り、コントローラーを2つ作る。
$ rails generate controller home index show
$ rails generate controller user show
homeにindexとshowが存在するのは、最初にhomeコントローラー内で完結する環境で実験を行ったため。本命は、home/index → user/show のコントローラー遷移とデータ表示だ。
1. config/routes.rb の設定
===ここから===
Rails.application.routes.draw do
get 'user/show'
post 'user/show'
get 'home/index'
post 'home/show'
get 'home/show'
# You can have the root of your site routed with "root"
root 'home#index'
end
===ここまで===
home/show環境でも実験したため、設定中に post 'home/show’ と get 'home/show' が残っているが、もちろん必要ない。
2. app/controllers 内の home_controller.rb と user_controller.rb の編集
home_controller.rbは次のように編集する。
===ここから===
class HomeController < ApplicationController
def index
end
def show
@msg=params[:contents]
end
end
===ここまで===
user_controller.rbは次のように編集する。
===ここから===
class UserController < ApplicationController
def show
@msg=params[:contents]
end
end
===ここまで===
home、userコントローラーでshowアクションが同じなので、ビューの設定でどちらのコントローラーでも実験が可能。
3. viewの編集 その1
app/views/home/index.html.erb を次のように編集する。
===ここから===
<h1>Home#index</h1>
<p>Find me in app/views/home/index.html.erb</p>
<%= form_tag(:controller =>"user", :action => "show") do%>
<div class="field">
<%= label_tag 'text' %> <br />
<%= text_area_tag 'contents','', :size => "60x10" %>
</div>
<div class="actions">
<%= submit_tag "send" %>
</div>
<% end %>
===ここまで===
form_tag(:controller =>"user", :action => "show") はsubmitボタンをクリックされたあと、コントローラーuserのshowアクションへ遷移しろという指定。:controller =>"user", のコントローラー指定がない場合は、コントローラーhome内のshowアクションへ遷移する。
また、入力フォームエリアが小さいと使いづらいので、サイズ変更をしている。
text_area_tag 'contents','', :size => "60x10"
リファレンスによると、text_area_tag(要素名 [, エリア配下のテキスト, オプション]) で、サイズ指定はオプション扱いなので「エリア配下のテキスト」が存在しない場合は必ず ,’’, を記述しておくこと。そうでないと、例えば , :size => "60x10" が初期値として書き込まれたフォームが表示される。
4. viewの編集 その2
app/views/user/show.html.erb を次のように編集する。
===ここから===
<h1>User#show</h1>
<p>Find me in app/views/user/show.html.erb</p>
<br />
<%= sanitize(simple_format(@msg)) %>
===ここまで===
app/views/home/index.html.erbで入力されたテキストは、こんな感じで app/controllers/user_controller.rb に引き渡されてくる。
Parameters: {"utf8"=>"✓", "authenticity_token"=>”なにやらお呪いなテキスト", "contents"=>"秋深し。\r\n隣りはなにをする人ぞ。\r\n>>javasvript\r\n<javascript>", "commit"=>"send"}
実際どうなるかはあとで説明するが、<html>などのタグを直接書き込めるようにしているとセキュリティホールになり得るので、危険性を取り除くためにサニタイズして表示させている。viewファイルの中で、<%= sanitize(simple_format(@msg)) %> と記述することでタグを除去している。
simple_formatは入力された文章をそのまま表示させるために必要。単純に<%= sanitize(@msg) %> とした場合、改行コードが働かずに表示される。
で、実際、こんな感じで動作する。
あっという間の一週間
日々がすっ飛んでゆく感じがします。
昔、米国でお世話になった日系二世のおばあさんから貰った手紙に ’Time Flyes’ と書いてあったことを思い出します。
ブログの更新をしたいんですが、コードを書いている夜は日々の開発日誌を書き続けていて、また、彼氏が来日しているときは終電まで酒を飲んで酔っ払っていてそれどころではなく。必然的にブログの更新は滞ってしまいますね。
開発日誌を書き続けることはとても大事で、なにが成功で、なにが失敗だったのか、後で読み返すと非常に勉強になります。先週から取り組んでいたのは、jQueryを二つ組み合わせた処理。
Ruby on Railsは多言語対応機能があり、僕のコードも最初から多言語対応で書かれています。
そのときリストが問題になりました。
約70行もあるリスト。そのままだとかなり画面スクロールを強いられる。
そのため3列程度に分割して、横に並べたら操作しやすくなります。
多言語対応のためにリストは3レターコードで表現し、特定の言語に縛られないようにしました。利用者がWebブラウザで見るときは、すでにそれぞれの言語に翻訳済みなので、3レターコードが利用者の目に触れることはほとんどありません。
さらにリストを降順(あいうえお順)に並べ替えると、利用者はより便利になります。
ただそうなると、リストの並び順は言語ごとに変わる可能性があり、予めタグをつけて分離部分を決めておくことはできません。
そこで、3レターコードのリストが翻訳された時点で内容に従って降順に並べ替え、かつ、複数列に分割して表示するjQueryプラグインを探して実装しました。
最初に、TinySortで降順ソートを行い、次にEasyListSplitter で複数列に分割することで期待通りの動きを実現しました。
最初EasyListSplitterでうまく列が並ばず四苦八苦しました。
落とし穴はCSSの定義がまずかったわけで、トライ&エラーで状況を把握したら期待通りの動きをしてくれて感激!
昔、米国でお世話になった日系二世のおばあさんから貰った手紙に ’Time Flyes’ と書いてあったことを思い出します。
ブログの更新をしたいんですが、コードを書いている夜は日々の開発日誌を書き続けていて、また、彼氏が来日しているときは終電まで酒を飲んで酔っ払っていてそれどころではなく。必然的にブログの更新は滞ってしまいますね。
開発日誌を書き続けることはとても大事で、なにが成功で、なにが失敗だったのか、後で読み返すと非常に勉強になります。先週から取り組んでいたのは、jQueryを二つ組み合わせた処理。
Ruby on Railsは多言語対応機能があり、僕のコードも最初から多言語対応で書かれています。
そのときリストが問題になりました。
約70行もあるリスト。そのままだとかなり画面スクロールを強いられる。
そのため3列程度に分割して、横に並べたら操作しやすくなります。
多言語対応のためにリストは3レターコードで表現し、特定の言語に縛られないようにしました。利用者がWebブラウザで見るときは、すでにそれぞれの言語に翻訳済みなので、3レターコードが利用者の目に触れることはほとんどありません。
さらにリストを降順(あいうえお順)に並べ替えると、利用者はより便利になります。
ただそうなると、リストの並び順は言語ごとに変わる可能性があり、予めタグをつけて分離部分を決めておくことはできません。
そこで、3レターコードのリストが翻訳された時点で内容に従って降順に並べ替え、かつ、複数列に分割して表示するjQueryプラグインを探して実装しました。
最初に、TinySortで降順ソートを行い、次にEasyListSplitter で複数列に分割することで期待通りの動きを実現しました。
最初EasyListSplitterでうまく列が並ばず四苦八苦しました。
落とし穴はCSSの定義がまずかったわけで、トライ&エラーで状況を把握したら期待通りの動きをしてくれて感激!
jQueryを使って、ラジオボタンにあわせて画面の表示・非表示を変更する。
日曜日の朝。
つけっぱなしにしていたTVでONE-PIECEが流れていて、不覚にも10分で泣かされた。
ワンピってさ、たいていの登場人物に悲しい過去があって、それには悲しい別れとか、自己犠牲のエピソードがあったりして、ぜったい泣かすのよ。レベッカと片足の兵隊さん。かんべんして〜。 (>_<)
で、先週から三歩進んで二歩下がる状態だったRailsのプログラムが、だいたい希望していた動きをし始めた。
たった1画面だよ。
バカみたいな話。
何にも分かっていないやつが、Rails相手にコントローラーつくったり、Viewで悪戦苦闘したり、そしてどうしても必要だったので、jQueryまで触ったよ。実験段階ではうまく動作したので、これからカフェでランチを食べながら本格的に実装開始。
デザインが全くされていないので、まるでブルックの状態。
なんだけど、動くものを見ていると愛おしい気持ちにはなる。
で、jQueryの内容について簡単な備忘録を残す。
ラジオボタンがいくつかあって、そのラジオボタンの動作にしたがってテーブルの一部分が表示されたり、隠されたりする簡単なもの。
まずページ読み込みの際に、hogehogeというネームのラジオボタンのチェックをすべて外し、ノーチェック状態にする。そして、表示変更される全部をいったん隠す。全体に対して、この場合は「test3a」というクラスを設定しておく。こうすれば全体を一括して表示、隠しができる。
そして、表示要素にidを設定しておいて、ラジオボタンのクリックされた状況に応じて表示させたり、隠したりをする。表示要素はこれから増えるはずなので、クラス test3aを使って一括で隠し、そのあとidで必要なものを表示させる方が合理的なんだろう。
ちなみに。
jQuery(“.test3a”).hide();
jQuery(“#test2a”).hide();
上記の差は、.test3aがクラスが対象、#test2aはidが対象な点。
==========
jQuery(function(){
//ページ読み込み時に実行したい処理
jQuery('input[name=“hogehoge”]’).attr("checked",false);
jQuery(“.test3a”).hide();
//表示・非表示の切り替え
jQuery(".test1").click(function(){
jQuery(“#test1a”).show();
jQuery(“#test2a”).hide();
});
jQuery(".test2").click(function(){
jQuery(“#test1a”).hide();
jQuery(“#test2a”).show();
});
});
==========
Viewの一部
==========
<tr class="test3a" id="test1a">
<th><%= f.label :追加情報1 %></th>
<td>
テスト1
</td>
</tr>
<tr class="test3a" id="test2a">
<th><%= f.label :追加情報2 %></th>
<td>
テスト2
</td>
</tr>
==========
つけっぱなしにしていたTVでONE-PIECEが流れていて、不覚にも10分で泣かされた。
ワンピってさ、たいていの登場人物に悲しい過去があって、それには悲しい別れとか、自己犠牲のエピソードがあったりして、ぜったい泣かすのよ。レベッカと片足の兵隊さん。かんべんして〜。 (>_<)
で、先週から三歩進んで二歩下がる状態だったRailsのプログラムが、だいたい希望していた動きをし始めた。
たった1画面だよ。
バカみたいな話。
何にも分かっていないやつが、Rails相手にコントローラーつくったり、Viewで悪戦苦闘したり、そしてどうしても必要だったので、jQueryまで触ったよ。実験段階ではうまく動作したので、これからカフェでランチを食べながら本格的に実装開始。
デザインが全くされていないので、まるでブルックの状態。
なんだけど、動くものを見ていると愛おしい気持ちにはなる。
で、jQueryの内容について簡単な備忘録を残す。
ラジオボタンがいくつかあって、そのラジオボタンの動作にしたがってテーブルの一部分が表示されたり、隠されたりする簡単なもの。
まずページ読み込みの際に、hogehogeというネームのラジオボタンのチェックをすべて外し、ノーチェック状態にする。そして、表示変更される全部をいったん隠す。全体に対して、この場合は「test3a」というクラスを設定しておく。こうすれば全体を一括して表示、隠しができる。
そして、表示要素にidを設定しておいて、ラジオボタンのクリックされた状況に応じて表示させたり、隠したりをする。表示要素はこれから増えるはずなので、クラス test3aを使って一括で隠し、そのあとidで必要なものを表示させる方が合理的なんだろう。
ちなみに。
jQuery(“.test3a”).hide();
jQuery(“#test2a”).hide();
上記の差は、.test3aがクラスが対象、#test2aはidが対象な点。
==========
jQuery(function(){
//ページ読み込み時に実行したい処理
jQuery('input[name=“hogehoge”]’).attr("checked",false);
jQuery(“.test3a”).hide();
//表示・非表示の切り替え
jQuery(".test1").click(function(){
jQuery(“#test1a”).show();
jQuery(“#test2a”).hide();
});
jQuery(".test2").click(function(){
jQuery(“#test1a”).hide();
jQuery(“#test2a”).show();
});
});
==========
Viewの一部
==========
<tr class="test3a" id="test1a">
<th><%= f.label :追加情報1 %></th>
<td>
テスト1
</td>
</tr>
<tr class="test3a" id="test2a">
<th><%= f.label :追加情報2 %></th>
<td>
テスト2
</td>
</tr>
==========
Ruby2.1.1 + Rails4.1.0 + MySQL5.6.17 でScaffoldしてみた。
なんか躓いて、一晩泣くハメになった。
今日、お昼頃に成功したんで「やったー!」と叫びました。
備忘録として作業メモを作っておきましょう。
MySQLはユーザアカウントの管理がキビしいので、まず、インストール済みのMySQLに作業用アカウントをつくることから始めてみた。
MySQLにはrootアカウントで入って、こんな感じで作業用カウントを作ってみた。
mysql > GRANT ALL ON *.* TO 'hogehoge'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
意味的には、'password'というパスワードで'localhost'から接続する'hogehoge'というユーザに管理者権限をつけるという感じ。ここら辺はちゃんと権限管理をすべきなんだろうけれど、いまは先を急ぐのでこれで行くよ。''は必要なので書き落とさないように注意。
じゃ、まずはRailsアプリを新規作成。
データベースはMySQLを指定。
[hogehoge@centos ~]$ rails new rails_app --database=mysql
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/secrets.yml
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/cookies_serializer.rb
create config/initializers/filter_parameter_logging.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.1
Using i18n 0.6.9
Using json 1.8.1
Using minitest 5.3.3
Using thread_safe 0.3.3
Using tzinfo 1.1.0
Using activesupport 4.1.0
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.0
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.0
Using activemodel 4.1.0
Using arel 5.0.1.20140414130214
Using activerecord 4.1.0
Using bundler 1.6.2
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.19.1
Using railties 4.1.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.9.2
Using jbuilder 2.0.6
Using jquery-rails 3.1.0
Using mysql2 0.3.15
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.0
Using rdoc 4.1.1
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.2
Using turbolinks 2.2.2
Using uglifier 2.5.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
run bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
で、rails_app内のGemfileを編集する。
[hogehoge@centos ~]$ cd rails_app
[hogehoge@centos ~]$ vi Gemfile
で、Gemfileを開き、これ(↓)のコメントアウトを外す(#を取り除く)
gem 'therubyracer', platforms: :ruby
で、再度コメントアウトしたファイルをbundleインストールする。
[hogehoge@centos rails_app]$ bundle install
Resolving dependencies...
Using rake 10.3.1
Using i18n 0.6.9
Using json 1.8.1
Using minitest 5.3.3
Using thread_safe 0.3.3
Using tzinfo 1.1.0
Using activesupport 4.1.0
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.0
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.0
Using activemodel 4.1.0
Using arel 5.0.1.20140414130214
Using activerecord 4.1.0
Using bundler 1.6.2
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.19.1
Using railties 4.1.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.9.2
Using jbuilder 2.0.6
Using jquery-rails 3.1.0
Using libv8 3.16.14.3
Using mysql2 0.3.15
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.0
Using rdoc 4.1.1
Using ref 1.0.5
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.2
Using therubyracer 0.12.1
Using turbolinks 2.2.2
Using uglifier 2.5.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
無駄なインストールが続いているような気がするけれど、therubyracer 0.12.1 が追加インストールされた。
じゃ、scaffoldの準備に取りかかりますか。
[hogehoge@centos rails_app]$ rails g scaffold Ranking name:string score:integer
invoke active_record
create db/migrate/20140420023921_create_rankings.rb
create app/models/ranking.rb
invoke test_unit
create test/models/ranking_test.rb
create test/fixtures/rankings.yml
invoke resource_route
route resources :rankings
invoke scaffold_controller
create app/controllers/rankings_controller.rb
invoke erb
create app/views/rankings
create app/views/rankings/index.html.erb
create app/views/rankings/edit.html.erb
create app/views/rankings/show.html.erb
create app/views/rankings/new.html.erb
create app/views/rankings/_form.html.erb
invoke test_unit
create test/controllers/rankings_controller_test.rb
invoke helper
create app/helpers/rankings_helper.rb
invoke test_unit
create test/helpers/rankings_helper_test.rb
invoke jbuilder
create app/views/rankings/index.json.jbuilder
create app/views/rankings/show.json.jbuilder
invoke assets
invoke coffee
create app/assets/javascripts/rankings.js.coffee
invoke scss
create app/assets/stylesheets/rankings.css.scss
invoke scss
create app/assets/stylesheets/scaffolds.css.scss
で、Ruby on Railsのモデルファイルが作成されたら、(この場合rails_app内の)configフォルダ内にあるdatabase.ymlのファイル内容をMySQLと接続するために書き換える。
[hogehoge@centos rails_app]$ cd config
[hogehoge@centos config]$ vi database.yml
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password:
socket: /var/lib/mysql/mysql.sock
となっているのをこんな感じに変更。
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: hogehoge
password: password
host: localhost
socket: /var/lib/mysql/mysql.sock
hostの部分は、Rails ServerとMySQLサーバとの関係によって、Localhostだったり、特定のIPアドレスだったりするらしい。
configのディレクトリから一つ上に上がっておく。
[hogehoge@centos rails_app]$ rake db:create
問題がなければエラーを吐かずに、何事もなかったようにコマンド入力待ちになる。
データベースがMySQL上に作成されたはずなので、次にテーブルをデータベース内に作成する。
[hogehoge@centos rails_app]$ rake db:migrate
== 20140420055229 CreateRankings: migrating ===================================
-- create_table(:rankings)
-> 0.0100s
== 20140420055229 CreateRankings: migrated (0.0101s) ==========================
これでテーブルも作られたらしい。
じゃあRails Serverを起動して結果を見てみよう。
[hogehoge@centos rails_app]$ rails server
Webブラウザを立ち上げて、アクセスしてみる。
※この時に、本当に気をつけて欲しいのは、URL表記のせいで、Routing Errorが出ても焦らないで欲しいということ。Railsのモデルを作成したとき、今回は確か「$ rails g scaffold Ranking name:string score:integer」としたので、モデル名はRankingと普通考えてしまう。だからWebブラウザでURLを「http://localhost:3000/ranking」とするとRouting Errorの表示が出るのでビックリする。
Railsの場合、モデル名は「複数形」になる(なってしまう?)ので、この場合のURLは「http://localhost:3000/rankings」と後ろにsをつけて複数形にすると、目的のページが表示されるはずだ。
こんな単純な落とし穴にハマって、昨夜から頭を抱えていたのがバカみたいだ。 (>_<)
今日、お昼頃に成功したんで「やったー!」と叫びました。
備忘録として作業メモを作っておきましょう。
MySQLはユーザアカウントの管理がキビしいので、まず、インストール済みのMySQLに作業用アカウントをつくることから始めてみた。
MySQLにはrootアカウントで入って、こんな感じで作業用カウントを作ってみた。
mysql > GRANT ALL ON *.* TO 'hogehoge'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
意味的には、'password'というパスワードで'localhost'から接続する'hogehoge'というユーザに管理者権限をつけるという感じ。ここら辺はちゃんと権限管理をすべきなんだろうけれど、いまは先を急ぐのでこれで行くよ。''は必要なので書き落とさないように注意。
じゃ、まずはRailsアプリを新規作成。
データベースはMySQLを指定。
[hogehoge@centos ~]$ rails new rails_app --database=mysql
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/secrets.yml
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/cookies_serializer.rb
create config/initializers/filter_parameter_logging.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.1
Using i18n 0.6.9
Using json 1.8.1
Using minitest 5.3.3
Using thread_safe 0.3.3
Using tzinfo 1.1.0
Using activesupport 4.1.0
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.0
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.0
Using activemodel 4.1.0
Using arel 5.0.1.20140414130214
Using activerecord 4.1.0
Using bundler 1.6.2
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.19.1
Using railties 4.1.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.9.2
Using jbuilder 2.0.6
Using jquery-rails 3.1.0
Using mysql2 0.3.15
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.0
Using rdoc 4.1.1
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.2
Using turbolinks 2.2.2
Using uglifier 2.5.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
run bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
で、rails_app内のGemfileを編集する。
[hogehoge@centos ~]$ cd rails_app
[hogehoge@centos ~]$ vi Gemfile
で、Gemfileを開き、これ(↓)のコメントアウトを外す(#を取り除く)
gem 'therubyracer', platforms: :ruby
で、再度コメントアウトしたファイルをbundleインストールする。
[hogehoge@centos rails_app]$ bundle install
Resolving dependencies...
Using rake 10.3.1
Using i18n 0.6.9
Using json 1.8.1
Using minitest 5.3.3
Using thread_safe 0.3.3
Using tzinfo 1.1.0
Using activesupport 4.1.0
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.0
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.0
Using activemodel 4.1.0
Using arel 5.0.1.20140414130214
Using activerecord 4.1.0
Using bundler 1.6.2
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.19.1
Using railties 4.1.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.9.2
Using jbuilder 2.0.6
Using jquery-rails 3.1.0
Using libv8 3.16.14.3
Using mysql2 0.3.15
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.0
Using rdoc 4.1.1
Using ref 1.0.5
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.2
Using therubyracer 0.12.1
Using turbolinks 2.2.2
Using uglifier 2.5.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
無駄なインストールが続いているような気がするけれど、therubyracer 0.12.1 が追加インストールされた。
じゃ、scaffoldの準備に取りかかりますか。
[hogehoge@centos rails_app]$ rails g scaffold Ranking name:string score:integer
invoke active_record
create db/migrate/20140420023921_create_rankings.rb
create app/models/ranking.rb
invoke test_unit
create test/models/ranking_test.rb
create test/fixtures/rankings.yml
invoke resource_route
route resources :rankings
invoke scaffold_controller
create app/controllers/rankings_controller.rb
invoke erb
create app/views/rankings
create app/views/rankings/index.html.erb
create app/views/rankings/edit.html.erb
create app/views/rankings/show.html.erb
create app/views/rankings/new.html.erb
create app/views/rankings/_form.html.erb
invoke test_unit
create test/controllers/rankings_controller_test.rb
invoke helper
create app/helpers/rankings_helper.rb
invoke test_unit
create test/helpers/rankings_helper_test.rb
invoke jbuilder
create app/views/rankings/index.json.jbuilder
create app/views/rankings/show.json.jbuilder
invoke assets
invoke coffee
create app/assets/javascripts/rankings.js.coffee
invoke scss
create app/assets/stylesheets/rankings.css.scss
invoke scss
create app/assets/stylesheets/scaffolds.css.scss
で、Ruby on Railsのモデルファイルが作成されたら、(この場合rails_app内の)configフォルダ内にあるdatabase.ymlのファイル内容をMySQLと接続するために書き換える。
[hogehoge@centos rails_app]$ cd config
[hogehoge@centos config]$ vi database.yml
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password:
socket: /var/lib/mysql/mysql.sock
となっているのをこんな感じに変更。
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: hogehoge
password: password
host: localhost
socket: /var/lib/mysql/mysql.sock
hostの部分は、Rails ServerとMySQLサーバとの関係によって、Localhostだったり、特定のIPアドレスだったりするらしい。
configのディレクトリから一つ上に上がっておく。
[hogehoge@centos rails_app]$ rake db:create
問題がなければエラーを吐かずに、何事もなかったようにコマンド入力待ちになる。
データベースがMySQL上に作成されたはずなので、次にテーブルをデータベース内に作成する。
[hogehoge@centos rails_app]$ rake db:migrate
== 20140420055229 CreateRankings: migrating ===================================
-- create_table(:rankings)
-> 0.0100s
== 20140420055229 CreateRankings: migrated (0.0101s) ==========================
これでテーブルも作られたらしい。
じゃあRails Serverを起動して結果を見てみよう。
[hogehoge@centos rails_app]$ rails server
Webブラウザを立ち上げて、アクセスしてみる。
※この時に、本当に気をつけて欲しいのは、URL表記のせいで、Routing Errorが出ても焦らないで欲しいということ。Railsのモデルを作成したとき、今回は確か「$ rails g scaffold Ranking name:string score:integer」としたので、モデル名はRankingと普通考えてしまう。だからWebブラウザでURLを「http://localhost:3000/ranking」とするとRouting Errorの表示が出るのでビックリする。
Railsの場合、モデル名は「複数形」になる(なってしまう?)ので、この場合のURLは「http://localhost:3000/rankings」と後ろにsをつけて複数形にすると、目的のページが表示されるはずだ。
こんな単純な落とし穴にハマって、昨夜から頭を抱えていたのがバカみたいだ。 (>_<)
CentOS6.5にMySQL5.6をインストールした手順
先人のお力添えで、なんとか実現しましたよ。
yumを使いました。
root権限でログオンして、次のコマンドを叩いていきました。
# rpm -qa | grep mysql
これで、現状MySQL5.1がインストールされていることを確認。
で、これらのrpmを削除。
# yum remove mysql*
で、最新のMySQLのrpmをyumに追加します。
# yum install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
そしてインストール。
# yum install mysql mysql-devel mysql-server mysql-utilities
バージョンを確認してみる。
[hoge@centos ~]$ mysql --version
mysql Ver 14.14 Distrib 5.6.17, for Linux (x86_64) using EditLine wrapper
ちゃんと新しいバージョンになっているみたい。
で、MySQLをサービスとして起動する。
# service mysqld start
mysqld を起動中: [ OK ]
ちゃんと動いているかな??
[hoge@centos ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
大丈夫らしいです。
文字コードの設定をやっておこう。
# vi /etc/my.cnf
そして、この一行を追加しておく。
[mysqld]
character-set-server=utf8
で、my.cnfを保存終了。
それからCentOSが起動したときに、MySQLも自動起動して欲しい。
# chkconfig mysqld on
どういう風になったのかチェック。
設定前:
# chkconfig --list |grep mysql
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
設定後:
# chkconfig --list |grep mysql
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
これでOK!
yumを使いました。
root権限でログオンして、次のコマンドを叩いていきました。
# rpm -qa | grep mysql
これで、現状MySQL5.1がインストールされていることを確認。
で、これらのrpmを削除。
# yum remove mysql*
で、最新のMySQLのrpmをyumに追加します。
# yum install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
そしてインストール。
# yum install mysql mysql-devel mysql-server mysql-utilities
バージョンを確認してみる。
[hoge@centos ~]$ mysql --version
mysql Ver 14.14 Distrib 5.6.17, for Linux (x86_64) using EditLine wrapper
ちゃんと新しいバージョンになっているみたい。
で、MySQLをサービスとして起動する。
# service mysqld start
mysqld を起動中: [ OK ]
ちゃんと動いているかな??
[hoge@centos ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
大丈夫らしいです。
文字コードの設定をやっておこう。
# vi /etc/my.cnf
そして、この一行を追加しておく。
[mysqld]
character-set-server=utf8
で、my.cnfを保存終了。
それからCentOSが起動したときに、MySQLも自動起動して欲しい。
# chkconfig mysqld on
どういう風になったのかチェック。
設定前:
# chkconfig --list |grep mysql
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
設定後:
# chkconfig --list |grep mysql
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
これでOK!
iPhoneからJSON経由でRuby on Railsにアクセスできた!
晴れのち雨。13.4℃/6.4℃/44%
春先だっていうのに積乱雲が発達したとかで、午前中の穏やかな晴れから一転して雨が降る。
フィットネスクラブで走っている最中に外の景色は暗くなってゆき、ほどなくして窓を雨がたたいた。
今日も10kmのRun & Walk。
土曜日も同じメニューをこなした後、ジャクジーで身体をほぐしたらぐっすり眠った。
今夜もそうなってくれるとありがたい。
今日もMacに向かってコードを書いていた。
コードったって、サンプルに毛が生えたようなものだけど。
VMware上で動いているCentOSにRuby on Railsを走らせていて、それをこしらえたiOS上のアプリからアクセスする。簡単に言うとデータをPutして、データベースに保存できるかどうかというしょうもない努力をしてた。
Railsでモデルを作り、iOS側は入力画面、データ入力後にソフトウェアキーボードを隠す仕組み、データベースと通信するためのAFNetworking、そしてJSONでパースする。Rails側に登録がうまく行ったことが判明したときに「やったー!!」とヒロ・ナカムラみたいに叫んだ。
今日一番うれしい瞬間だったな。
春先だっていうのに積乱雲が発達したとかで、午前中の穏やかな晴れから一転して雨が降る。
フィットネスクラブで走っている最中に外の景色は暗くなってゆき、ほどなくして窓を雨がたたいた。
今日も10kmのRun & Walk。
土曜日も同じメニューをこなした後、ジャクジーで身体をほぐしたらぐっすり眠った。
今夜もそうなってくれるとありがたい。
今日もMacに向かってコードを書いていた。
コードったって、サンプルに毛が生えたようなものだけど。
VMware上で動いているCentOSにRuby on Railsを走らせていて、それをこしらえたiOS上のアプリからアクセスする。簡単に言うとデータをPutして、データベースに保存できるかどうかというしょうもない努力をしてた。
Railsでモデルを作り、iOS側は入力画面、データ入力後にソフトウェアキーボードを隠す仕組み、データベースと通信するためのAFNetworking、そしてJSONでパースする。Rails側に登録がうまく行ったことが判明したときに「やったー!!」とヒロ・ナカムラみたいに叫んだ。
今日一番うれしい瞬間だったな。
Rails4.0でActionController::InvalidAuthenticityTokenでエラーになった場合
「Herokuではじめる Railsプログラミング入門」のサンプルでうまく動かなかった原因が分かったのでメモを残しておきます。P,160からの「フォームを送信しよう」を入力して動かしてみた。
最初の画面
で、エラー画面。
googleさまに対処方法を尋ねたら、Rails2.0よりCSRF(クロスサイトリクエストフォージェリ)対策が施されているため、エラーになってしまうのだとか。クロスサイトリクエストフォージェリとは「Webサイトにスクリプトや自動転送(HTTPリダイレクト)を仕込むことによって、閲覧者に意図せず別のWebサイト上で何らかの操作(掲示板への書き込みなど)を行わせる攻撃手法」だそうで、代表的なサイバー攻撃の一つだとか。
で。この対応策として、sample_controller.rbに次の一行(赤字のやつ)を書き足した。
====================================
#coding:utf-8
class SampleController < ApplicationController
skip_before_filter :verify_authenticity_token ,:only=>[:index2]
def index2
if request.post? then
@msg = "you type: " + params[:text1]
else
@msg="なにか入力してください。"
end
end
end
====================================
で、再度実行してみると、無事にこちらの画面が出現。
「Herokuではじめる Railsプログラミング入門」のミスでもなんでもなくて、もともとRuby1.9.3とRails3の組み合わせで書かれているので問題が出ないのかもしれません。
最初の画面
で。この対応策として、sample_controller.rbに次の一行(赤字のやつ)を書き足した。
====================================
#coding:utf-8
class SampleController < ApplicationController
skip_before_filter :verify_authenticity_token ,:only=>[:index2]
def index2
if request.post? then
@msg = "you type: " + params[:text1]
else
@msg="なにか入力してください。"
end
end
end
====================================
で、再度実行してみると、無事にこちらの画面が出現。
「Herokuではじめる Railsプログラミング入門」のミスでもなんでもなくて、もともとRuby1.9.3とRails3の組み合わせで書かれているので問題が出ないのかもしれません。
Linuxのディレクトリやファイルのグループ変更はchgrpを使う。
さてと。
CentOS上のRuby on Railsにトラブルが起こっている。
一通りインストールを終えた後、テスト用のプロジェクトを作ってみようとするとエラーが発生。
========================================
[rails@centos ~]$ rails new testrails
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
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/filter_parameter_logging.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
/usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `initialize': Permission denied @ rb_sysopen - Makefile (Errno::EACCES)
from /usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `open'
from /usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `create_makefile'
from extconf.rb:55:in `
'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/sqlite3-1.3.9/gem_make.out
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
from /usr/local/lib/ruby/2.1.0/tempfile.rb:324:in `open'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `each'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `find'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems.rb:185:in `try_activate'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/net/http/persistent.rb:12:in `'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendored_persistent.rb:3:in `'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/fetcher.rb:1:in `'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli/install.rb:68:in `run'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli.rb:146:in `install'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/base.rb:440:in `start'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli.rb:9:in `start'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/bin/bundle:20:in `block in'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/bin/bundle:20:in `'
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! [rails@centos ~]$
========================================
なんとなく吐き出されたメッセージを見ていると、bundle install以降にトラブルが発生していて、それも/usr/local/lib/ruby 以下のアクセス権に問題が発生している模様。
ディレクトリ、ファイルはインストール時に所有者がrootになっているのは仕方ないとして、利用者グループを変更することで、この問題を解決したい。
もともとrailsでいろいろ実験するアカウントは、railsというグループに所属させていた。だからこのグループが/usr/local/lib/ruby/以下のすべてのファイル、ディレクトリに対し「読み書き」ができるようにしてあげれば良いのではないかと。
所有者がrootなので、suコマンドなどで一時的にrootになり、/usr/local/lib/の位置でrubyディレクトリに対し次のコマンドを叩くと良い。
chgrp -R rails ruby
(意味は、rubyのディレクトリとその中身のグループを全部railsに変更する)
これで、rubyディレクトリの中身すべてのグループがrailsになる。
それからrubyディレクトリに対し、railsグループが読み書き実行できるようにアクセス権の変更を行う。
chmod -R g+rwx ruby
あらためて rails new testrails を叩くと、問題なく終了するはず。
はぁ、それにしてもUnix系のOSは、アクセス権の設定でつまづくことが多いような気がする。
Windowsのお気楽なアクセス権設定とは雲泥の差だわ。
CentOS上のRuby on Railsにトラブルが起こっている。
一通りインストールを終えた後、テスト用のプロジェクトを作ってみようとするとエラーが発生。
========================================
[rails@centos ~]$ rails new testrails
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
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/filter_parameter_logging.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
/usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `initialize': Permission denied @ rb_sysopen - Makefile (Errno::EACCES)
from /usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `open'
from /usr/local/lib/ruby/2.1.0/mkmf.rb:2189:in `create_makefile'
from extconf.rb:55:in `
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/sqlite3-1.3.9/gem_make.out
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
from /usr/local/lib/ruby/2.1.0/tempfile.rb:324:in `open'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `each'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `find'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems.rb:185:in `try_activate'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/net/http/persistent.rb:12:in `
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendored_persistent.rb:3:in `
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/fetcher.rb:1:in `
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli/install.rb:68:in `run'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli.rb:146:in `install'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/vendor/thor/base.rb:440:in `start'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/cli.rb:9:in `start'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/bin/bundle:20:in `block in
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.6.0.rc2/bin/bundle:20:in `
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
========================================
なんとなく吐き出されたメッセージを見ていると、bundle install以降にトラブルが発生していて、それも/usr/local/lib/ruby 以下のアクセス権に問題が発生している模様。
ディレクトリ、ファイルはインストール時に所有者がrootになっているのは仕方ないとして、利用者グループを変更することで、この問題を解決したい。
もともとrailsでいろいろ実験するアカウントは、railsというグループに所属させていた。だからこのグループが/usr/local/lib/ruby/以下のすべてのファイル、ディレクトリに対し「読み書き」ができるようにしてあげれば良いのではないかと。
所有者がrootなので、suコマンドなどで一時的にrootになり、/usr/local/lib/の位置でrubyディレクトリに対し次のコマンドを叩くと良い。
chgrp -R rails ruby
(意味は、rubyのディレクトリとその中身のグループを全部railsに変更する)
これで、rubyディレクトリの中身すべてのグループがrailsになる。
それからrubyディレクトリに対し、railsグループが読み書き実行できるようにアクセス権の変更を行う。
chmod -R g+rwx ruby
あらためて rails new testrails を叩くと、問題なく終了するはず。
はぁ、それにしてもUnix系のOSは、アクセス権の設定でつまづくことが多いような気がする。
Windowsのお気楽なアクセス権設定とは雲泥の差だわ。
Railsの新規プロジェクトを作成するときは
だいたいいつも忘れてしまっているので、備忘録代わりに。
この原稿を書いているときにテキストエディタがハングして全部パーになったので、ちょっとイラッとしながら再度書き直そう。
Railsのプロジェクトを新規作成するのは、現在Aptana Studio3のGUIからは不可能になっているみたいだ。だからターミナルを立ち上げるか、あるいはAptana Studio3内のターミナルでユーティリティスクリプトを叩く。いずれにしてもターミナルを立ち上げる。
Railsのプロジェクトを作成するディレクトリへ移動して、このコマンドを叩く。
rails new プロジェクト名
すると、大体こんな風に進行する。
途中でパスワードの入力が求められる。
(つまりsudoコマンドが使える状態になっているということ)
$ rails new myapp
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
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/filter_parameter_logging.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
Password:
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.1.1
Using i18n 0.6.9
Using minitest 4.7.5
Installing multi_json 1.9.0
Using atomic 1.1.15
Using thread_safe 0.2.0
Using tzinfo 0.3.38
Using activesupport 4.0.3
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.0.3
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.0.3
Using activemodel 4.0.3
Using activerecord-deprecated_finders 1.0.3
Using arel 4.0.2
Using activerecord 4.0.3
Using bundler 1.6.0.rc
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.18.1
Using railties 4.0.3
Using coffee-rails 4.0.1
Using hike 1.2.3
Using jbuilder 1.5.3
Using jquery-rails 3.1.0
Using json 1.8.1
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.0.1
Using rails 4.0.3
Using rdoc 4.1.1
Using sass 3.2.14
Using sass-rails 4.0.1
Using sdoc 0.4.0
Using sqlite3 1.3.9
Using turbolinks 2.2.1
Using uglifier 2.4.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
$
で、新規プロジェクトが出来上がっているはず。
この原稿を書いているときにテキストエディタがハングして全部パーになったので、ちょっとイラッとしながら再度書き直そう。
Railsのプロジェクトを新規作成するのは、現在Aptana Studio3のGUIからは不可能になっているみたいだ。だからターミナルを立ち上げるか、あるいはAptana Studio3内のターミナルでユーティリティスクリプトを叩く。いずれにしてもターミナルを立ち上げる。
Railsのプロジェクトを作成するディレクトリへ移動して、このコマンドを叩く。
rails new プロジェクト名
すると、大体こんな風に進行する。
途中でパスワードの入力が求められる。
(つまりsudoコマンドが使える状態になっているということ)
$ rails new myapp
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
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/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
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/filter_parameter_logging.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 lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
Password:
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.1.1
Using i18n 0.6.9
Using minitest 4.7.5
Installing multi_json 1.9.0
Using atomic 1.1.15
Using thread_safe 0.2.0
Using tzinfo 0.3.38
Using activesupport 4.0.3
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.0.3
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.0.3
Using activemodel 4.0.3
Using activerecord-deprecated_finders 1.0.3
Using arel 4.0.2
Using activerecord 4.0.3
Using bundler 1.6.0.rc
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.18.1
Using railties 4.0.3
Using coffee-rails 4.0.1
Using hike 1.2.3
Using jbuilder 1.5.3
Using jquery-rails 3.1.0
Using json 1.8.1
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.0.1
Using rails 4.0.3
Using rdoc 4.1.1
Using sass 3.2.14
Using sass-rails 4.0.1
Using sdoc 0.4.0
Using sqlite3 1.3.9
Using turbolinks 2.2.1
Using uglifier 2.4.0
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
$
で、新規プロジェクトが出来上がっているはず。
登録:
投稿 (Atom)