How to install Refinery CMS using Rails 4
Asked Answered
O

5

5

I previously never had a problem with Refinery. I was refreshing my knowledge by following along to the tutorial http://railscasts.com/episodes/332-refinery-cms-basics .Then when I created a new app with Refinery CMS, I got this error

Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    refinerycms (~> 2.1.0) ruby depends on
      actionmailer (< 3.3, >= 3.1.3) ruby

    rails (= 4.0.0) ruby depends on
      actionmailer (4.0.0)

But should not these things be there by default with the CMS? why would there be errors only now?

Outplay answered 21/8, 2013 at 18:23 Comment(1)
So an edit was suggested here and 3 members approved. But that then changes the context from a troubleshooting question to a "how-to" question. It then confuses my question details and then renders the currently accepted to no longer be the best answer.Outplay
T
3

Well, my five cents are that Refinery is not yet available for Rails 4:

Best, Ben.

Tillotson answered 27/8, 2013 at 0:40 Comment(0)
K
15

The latest code supports Rails 4; the gem must be sourced from the master branch, until a release is made.

Git Issue #2428 - Rails 4 support

Add to your Gemfile:

gem 'refinerycms-i18n', github: 'refinery/refinerycms-i18n', branch: 'master'
gem 'refinerycms', github: 'refinery/refinerycms', branch: "master"
# Strong parameters is a new feature not used by Refinery
gem 'protected_attributes'

Do a:

$ bundle install 

Create a new Refinery app, the command will be different depending on what you want to do. For that there are a few guides that you can follow. In my case, I added it to an existing app with:

$ rails generate refinery:cms --fresh-installation

Start your server and go to: http://localhost:3000/refinery

Kennet answered 15/12, 2013 at 21:38 Comment(3)
It seems, adding gem 'protected_attributes' giving error: Validation failed: Title can't be blank. And according to github.com/refinery/refinerycms-news/issues/140 , removing this gem is solution...Lysenkoism
your steps helped me with this! I left out the protected_attributes gemJugular
How do you modify the generate command to make it use MySQL instead?Ovida
T
3

Well, my five cents are that Refinery is not yet available for Rails 4:

Best, Ben.

Tillotson answered 27/8, 2013 at 0:40 Comment(0)
M
2

Simply initialize the application using:

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

Behind the scenes: This command makes your application use the master branch of refinery, which supports Rails 4.

Update Although the above is the easiest and official way, it didn't totally work for me. I had to manually run the following command after the above one:

 rails generate refinery:cms --fresh-installation
Matriculate answered 19/3, 2015 at 3:58 Comment(0)
O
1

Looks like the rails4 branch has been getting a bit of love over the past few days:

https://github.com/refinery/refinerycms/tree/rails4

I will try it out and update with how I get on.

Orlov answered 4/9, 2013 at 7:30 Comment(1)
Looks like rails4 is on master branch now, and they are working on rails 4.1: github.com/refinery/refinerycms/tree/rails-4-1 I just don't know why they haven't released a new gem with Rails 4.0 as they are already working on 4.1Charlotte
C
0

OK, let's try and answer this one. This is the route I went down.

First, I installed the refinerycms gem.

gem install refinerycms

I then did a:

rbenv rehash

Then I followed the guide:

refinerycms rickrockstar

Bundler complained:

Bundler could not find compatible versions for gem "refinerycms-core":
  In Gemfile:
    refinerycms (~> 3.0) ruby depends on
      refinerycms-images (= 3.0.0) ruby depends on
        refinerycms-core (= 3.0.0) ruby

refinerycms (~> 3.0) ruby depends on
  refinerycms-images (= 3.0.0) ruby depends on
    refinerycms-core (= 3.0.0) ruby

refinerycms (~> 3.0) ruby depends on
  refinerycms-images (= 3.0.0) ruby depends on
    refinerycms-core (= 3.0.0) ruby

refinerycms (~> 3.0) ruby depends on
  refinerycms-images (= 3.0.0) ruby depends on
    refinerycms-core (= 3.0.0) ruby

refinerycms-wymeditor (>= 1.0.6, ~> 1.0) ruby depends on
  refinerycms-core (>= 3.0.0, ~> 3.0) ruby

refinerycms-acts-as-indexed (>= 1.0.0, ~> 1.0) ruby depends on
  refinerycms-core (~> 2.1.0) ruby

In my gemfile, I changed the following lines: gem 'rails', '4.2.4'

gem 'refinerycms'
gem 'refinerycms-acts-as-indexed'
gem 'refinerycms-wymeditor'

And this solved the issue.

I had to then do a:

bundle install

Then a:

rails generate refinery:cms --fresh-installation

I posted an issue on github and got the following answer from the RefineryTeam:

 It looks like the culprit was refinerycms-acts-as-indexed version - it should be ~> 2.0.1 to work with Refinery 3.0.0

https://github.com/refinery/refinerycms/issues/3072

Please also see this page where things might be running more smoothly than following the guide on Refinery's website. What is to be seen there is similar to Zuhaib Ali's answer above (in a bit more details).

Hope this helps

Comus answered 18/11, 2015 at 22:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.