refinerycms icon indicating copy to clipboard operation
refinerycms copied to clipboard

Problem with Railties

Open JGallardo opened this issue 13 years ago • 5 comments

Previous versions seemed to have worked out of the box. But now when I walked through the install of this version, I ran into this error

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    coffee-rails (~> 3.2.2) ruby depends on
      railties (~> 3.2.0) ruby

    railties (4.0.0)

Why does this problem exist by default? when I manually changed the version, I then got a different error

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    refinerycms-settings (>= 0) ruby depends on
      actionpack (!= 3.2.0, != 3.2.1, != 3.2.10, != 3.2.11, != 3.2.2, != 3.2.3, != 3.2.4, != 3.2.5, != 3.2.6, != 3.2.7, != 3.2.8, != 3.2.9, < 3.3, >= 3.1.11) ruby

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

So I installed actionpack but then ran into this issue

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    railties (~> 3.2.0) ruby

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

These problems should not be happening from the default. Not sure if there is something on my end causing this, but in previous versions I never had a problem with Refinery.

JGallardo avatar Aug 21 '13 22:08 JGallardo

Please post your Gemfile

parndt avatar Aug 21 '13 23:08 parndt

Currently this is what I have

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'


gem 'locomotive_cms', '~> 2.0.1', :require => 'locomotive/engine'

group :assets do
  gem 'compass-rails',  '~> 1.0.2'
  gem 'sass-rails',     '~> 3.2.4'
  gem 'coffee-rails',   '~> 3.2.2'
  gem 'uglifier',       '~> 1.2.4'

  # If you run your engine on **Linux,** you also have to add the following gem
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem "railties", "~> 3.2.0"
end

gem "actionpack", "~> 4.0.0"

group :development do
  gem 'unicorn'
end

gem 'refinerycms-blog', github: 'refinery/refinerycms-blog', branch: 'master'
gem 'refinerycms-settings', github: 'refinery/refinerycms-settings', branch: 'master'

I have only added the actionpack gem and then the last two gems for the blog.

JGallardo avatar Aug 21 '13 23:08 JGallardo

Okay, here's the problems I see:

  • You're specifying Rails 4.0, which Refinery 2.1.0 is not compatible with.
  • You're not actually specifying refinerycms anywhere.. this should be roughly okay though as long as you don't mind implementing authentication just to use the blog extension.
  • You're specifying railties 3.2.0 in the :assets group for some reason which also conflicts with Rails 4.0.0 (which, again, won't be supported by the Refinery dependencies)
  • You don't need to specify actionpack if you're specifying rails already
  • sass-rails 3.2.x and coffee-rails 3.2.x aren't compatible with Rails 4.0 and I'm wondering whether compass-rails 1.0.x is either.

Hope that helps.

parndt avatar Aug 21 '13 23:08 parndt

I create an app with the refinerycms command, should that not work by default? Not sure what is wrong this time because previously everything just worked and I did not have to write anything about refinerycms

I might have been following a wrong tutorial that told me to add refinery later. So I just created a new app with refinery. Then I got the error

Could not find gem 'rails (= 3.2.14) ruby' in the gems available on this machine.

So I installed, then tried running rails server per the tutorial. But then i got this

/Users/juan.gallardo/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
/Users/juan.gallardo/.rvm/gems/ruby-1.9.3-p448@refinery/gems/rails-2.3.14/lib/rails_generator/generators/applications/app/app_generator.rb:7: Use RbConfig instead of obsolete and deprecated Config.

and then began attempting to install refinery all over again. and prompted me with

overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] y
   force  config/initializers/session_store.rb
overwrite config/initializers/cookie_verification_secret.rb? (enter "h" for help) [Ynaqdh] y
   force  config/initializers/cookie_verification_secret.rb

Here is the strange thing, on this install I got this Gemfile by default

source 'https://rubygems.org'

gem 'rails', '3.2.14'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

But then when I created another refinery cms app (just to test) I got the message that refinery had installed, but after i ran bundle and tried to run on locahost, I got this

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)

JGallardo avatar Aug 22 '13 00:08 JGallardo

Refinery CMS 2.1.0 is not compatible with Rails 4. When you run refinerycms command it loads Rails you have currently installed (Rails 4 in your case) and thus fail to generate a working application.

We recently addressed this in getting started guide. Solution is to use template (which Refinery actually does behind the scenes) to generate new Rails/Refinery application:

rails _3.2.14_ new rickrockstar -m http://refinerycms.com/t/2.1.0

rails _3.2.14_ - this is how you specify a version of Rails to be used (assuming Rails 3.2.14 has been installed). -m http://refinerycms.com/t/2.1.0 - this is where you tell Rails generator to apply template when you generate new app.

ugisozols avatar Aug 25 '13 13:08 ugisozols