refinary tutorial no work チュートリアル動かない 再考:ダウンロードページhttp://www.refinerycms.com/downloadより再構築

rails4で動く、動かない両方の記述が散出しているので、
https://github.com/refinery/refinerycms/issues/3032
を元に現時点(2015/9月)でのインストールとチュートリアル(http://www.refinerycms.com/guides/getting-started/#rails-application-templates)の突合せ

System Pre-install (Ubuntu14.04)
apt-get install imagemagick sqlite3
rvm+ruby2.0.0 (以後rails4.2.4使うための準備)

Install Rails
$ gem install rails (--version 4.1.8)
現時点でオプションがなければ4.2.4がインストールされる。

ruby 1.9.3でもダウンロードページにあるは$gem install rails --version 4.1.8実行できるかもしれないが、そのままだと次の$ rails new rickrockstar -m http://refinerycms.com/t/edgeででる以下のエラーがうまく修正できない。

Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (= 4.1.8) ruby depends on
railties (= 4.1.8) ruby depends on
actionpack (= 4.1.8) ruby

rails (= 4.1.8) ruby depends on
railties (= 4.1.8) ruby depends on
actionpack (= 4.1.8) ruby

rails (= 4.1.8) ruby depends on
railties (= 4.1.8) ruby depends on
actionpack (= 4.1.8) ruby

refinerycms (>= 0) ruby depends on
refinerycms-core (= 3.0.0) ruby depends on
actionpack (< 5.0, >= 4.2.3) ruby

推測だがrails (= 4.1.8)をそのまま使うと、同じactionpackの別バージョンが必要という、矛盾が起こるらしい。



Generate an Application

$ rails new rickrockstar -m http://refinerycms.com/t/edge

ここで以下のエラーが出る。
rake db:create
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
/home/johny/.rvm/gems/ruby-2.0.0-p643/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect'
/home/johny/.rvm/gems/ruby-2.0.0-p643/gems/execjs-2.6.0/lib/execjs.rb:5:in `'
...

これはGemfileを修正してなおすことで治る

$ cd rickrockstar/
$ nano Gemfile

# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby (コメントはずす)

ここで普通ならbundle installでgemsetは直るが、前回のGenerateでエラーがでで失敗した部分のインストールが終わっていない。例えばチュートリアルにあるconfig/initializers/refinery/core.rbはこの時点では生成されていない。
そこでもう一度
$ cd ../
$ rails new rickrockstar -m http://refinerycms.com/t/edge

を行うが、修正したGemfileを上書きし無い様に以下の警告にn(No)と答える。それ以外は全てYで上書きOKする。
conflict .gitignore
Overwrite /home/user/rickrockstar/.gitignore? (enter "h" for help) [Ynaqdh] Y ←以下以外はすべてY、(上書き)
force .gitignore
conflict Gemfile
Overwrite /home/user/rickrockstar/Gemfile? (enter "h" for help) [Ynaqdh] n ←ここ
skip Gemfile

以上でチュートリアル(http://www.refinerycms.com/guides/getting-started)4.1 Starting up the Web Serverから始めることが出来る。





$ rails new rickrockstar -m http://refinerycms.com/t/edge