Refinerycms安装

安装

$ gem install refinerycms
Downloading http://ruby.taobao.org/latest_specs.4.8.gz
File already downloaded and cached to /home/panfeng/.rvm/gems/ruby-1.9.3-p0/cache
Downloading http://ruby.taobao.org/specs.4.8.gz
File already downloaded and cached to /home/panfeng/.rvm/gems/ruby-1.9.3-p0/cache
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: refinerycms requires refinerycms-authentication (= 2.0.8), refinerycms-dashboard (= 2.0.8), refinerycms-images (= 2.0.8), refinerycms-pages (= 2.0.8), refinerycms-resources (= 2.0.8)

此时需要分别安装这几个依赖库,然后再安装refinerycms就可以了

refinerycms-i18n也需要安装,否则bundle install会报错

$ gem install refinerycms-i18n

创建新项目

$ refinerycms rfcms

如果bundle install出错可能是因为默认使用https://rubygems.org源下载超时

修改Gemfile,使用taobao源再运行一次bundle install

source 'http://ruby.taobao.org'
#source 'https://rubygems.org'

同时,没有找到JavaScript库导致refinerycms中止,错误信息如下:

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
        rake    db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
(See full trace by running task with --trace)
    generate    refinery:cms --fresh-installation
/home/panfeng/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

解决方法是在Gemfile把Javascript库注释打开,然后重新运行下面的命令

gem 'therubyracer', :platforms => :ruby

$ rails generate refinery:cms --fresh-installation

启动

$ rails server

参考

http://refinerycms.com/guides/with-an-existing-rails-app/

http://refinerycms.com/guides/getting-started

原文地址:https://www.cnblogs.com/scige/p/2664658.html