0

As part of a larger project I've been tasked with migrating some existing Ruby on Rails sites (built with an old version of refinerycms 0.9.6.34, at least that's the version listed in the Gemfile included with the source). I don't normally work with Ruby so I'm at a bit of a loss. The previous developers simply handed over the latest git dump as well as a db dump.

I'm working first with trying to get the site up working locally on an Ubuntu 11.10 local machine before pushing up to at test Heroku install. If it's possible to just push directly to Heroku with the files they gave, then I can try that, but it's my understanding I need to get everything working and then use Heroku's tools to deploy.

The previous devs said they're using ruby 1.8.7 so in Ubuntu I've done the following:

aptitude install ruby1.8 ruby1.8-dev ruby1.8-full
aptitude install rubygems1.8

I've restored the database and in the config directory I've made changes to the database.yml to point to the restored database.

When I try and run "bundle install" from the root of the extracted source dir I get:

Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/sass-rails-3.2.5.gemspec]: invalid date format in specification: "2012-03-19 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-2.0.2.gemspec]: invalid date format in specification: "2012-04-03 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/sass-rails-3.2.5.gemspec]: invalid date format in specification: "2012-03-19 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-2.0.2.gemspec]: invalid date format in specification: "2012-04-03 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/sass-rails-3.2.5.gemspec]: invalid date format in specification: "2012-03-19 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-2.0.2.gemspec]: invalid date format in specification: "2012-04-03 00:00:00.000000000Z"
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.3)
Using builder (3.0.0)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.3)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Installing tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.3)
Installing mime-types (1.18)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Installing mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Using acts_as_indexed (0.7.8)
Using awesome_nested_set (2.1.3)
Using babosa (0.3.7)
Using bcrypt-ruby (3.0.1)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.3)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.3)
Using coffee-rails (3.2.2)
Using orm_adapter (0.0.7)
Using warden (1.1.1)
Using devise (2.0.4)
Using dragonfly (0.9.12)
Using friendly_id (4.0.6)
Using paper_trail (2.6.3)
Using globalize3 (0.2.0)
Installing jquery-rails (2.0.2)
Using bundler (1.1.4)
Using rails (3.2.3)
Using sass (3.1.19)
Installing sass-rails (3.2.5)
Using truncate_html (0.5.5)
Using uglifier (1.2.4)
Using will_paginate (3.0.3)
Using refinerycms-core (2.0.4)
Using refinerycms-authentication (2.0.4)
Using refinerycms-dashboard (2.0.4)
Using refinerycms-images (2.0.4)
Using seo_meta (1.3.0)
Using refinerycms-pages (2.0.4)
Using refinerycms-resources (2.0.4)
Using refinerycms (2.0.4)
Using routing-filter (0.3.1)
Using refinerycms-i18n (2.0.0)
Using sqlite3 (1.3.6)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Obviously the errors with Invalid gemspec need to be resolved, but the other thing that's troubling to me are the lines:

Using refinerycms-core (2.0.4)
Using refinerycms-authentication (2.0.4)
Using refinerycms-dashboard (2.0.4)
Using refinerycms-images (2.0.4)
Using seo_meta (1.3.0)
Using refinerycms-pages (2.0.4)
Using refinerycms-resources (2.0.4)
Using refinerycms (2.0.4)
Using routing-filter (0.3.1)
Using refinerycms-i18n (2.0.0)

Since the refinerycms version listed in the Gemfile was 0.9.6.34.

When it comes to the Ruby world, I'm a bit lost so any help would be greatly appreciated.

Thanks,

UPDATE As requested the gemfile looks like:

source 'http://rubygems.org'

gem 'refinerycms', '= 0.9.6.34'
gem 'rails', '~> 2.3.14'

gem 'mysql2', '~> 0.2.18'

gem 'hpricot'
gem 'rmagick', '= 2.12.2'

Also, this is what's in the Gemfile.lock file:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.3)
      actionpack (= 4.2.3)
      mail (~> 2.4.4)
    actionpack (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.1)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.2)
    activemodel (3.2.3)
      activesupport (= 3.2.3)
      builder (~> 3.0.0)
    activerecord (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
    activesupport (3.2.3)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    acts_as_indexed (0.7.8)
    arel (3.0.2)
    awesome_nested_set (2.1.3)
      activerecord (>= 3.0.0)
    babosa (0.3.7)
    bcrypt-ruby (3.0.1)
    builder (3.0.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.3.3)
    devise (2.0.4)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.0.3)
      railties (~> 3.1)
      warden (~> 1.1.1)
    dragonfly (0.9.12)
      rack
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    friendly_id (4.0.6)
    globalize3 (0.2.0)
activemodel (>= 3.0.0)
      activerecord (>= 3.0.0)
      paper_trail (~> 2)
    hike (1.2.1)
    i18n (0.6.0)
    journey (1.0.3)
    jquery-rails (2.0.2)
      railties (>= 3.2.0, < 5.0)
      thor (~> 0.14)
    json (1.7.3)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.18)
    multi_json (1.3.6)
    orm_adapter (0.0.7)
    paper_trail (2.6.3)
      activerecord (~> 3.0)
      railties (~> 3.0)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.2.3)
      actionmailer (= 3.2.3)
      actionpack (= 3.2.3)
      activerecord (= 3.2.3)
      activeresource (= 3.2.3)
      activesupport (= 3.2.3)
      bundler (~> 1.0)
      railties (= 3.2.3)
    railties (3.2.3)
      actionpack (= 3.2.3)
      activesupport (= 3.2.3)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (0.9.2.2)
    rdoc (3.12)
      json (~> 1.4)
    refinerycms (2.0.4)
      bundler (~> 1.0)
      refinerycms-authentication (= 2.0.4)
      refinerycms-core (= 2.0.4)
      refinerycms-dashboard (= 2.0.4)
      refinerycms-images (= 2.0.4)
      refinerycms-pages (= 2.0.4)
      refinerycms-resources (= 2.0.4)
    refinerycms-authentication (2.0.4)
      devise (~> 2.0.0)
      orm_adapter (~> 0.0.7)
      refinerycms-core (= 2.0.4)
    refinerycms-core (2.0.4)
      acts_as_indexed (~> 0.7.7)
      awesome_nested_set (~> 2.1.3)
      coffee-rails (~> 3.2.1)
      friendly_id (~> 4.0.1)
      globalize3 (~> 0.2.0)
      jquery-rails (~> 2.0.0)
      rails (>= 3.1.3, < 3.3)
      sass-rails (~> 3.2.3)
      truncate_html (~> 0.5)
      uglifier (>= 1.0.3)
      will_paginate (~> 3.0.2)
    refinerycms-dashboard (2.0.4)
      refinerycms-core (= 2.0.4)
   refinerycms-i18n (2.0.0)
      refinerycms-core (~> 2.0.0)
      routing-filter (>= 0.2.3)
    refinerycms-images (2.0.4)
      dragonfly (~> 0.9.8)
      rack-cache (>= 0.5.3)
      refinerycms-core (= 2.0.4)
    refinerycms-pages (2.0.4)
      awesome_nested_set (~> 2.1.3)
      babosa (!= 0.3.6)
      refinerycms-core (= 2.0.4)
      seo_meta (~> 1.3.0)
    refinerycms-resources (2.0.4)
      dragonfly (~> 0.9.8)
      rack-cache (>= 0.5.3)
      refinerycms-core (= 2.0.4)
    routing-filter (0.3.1)
      actionpack
    sass (3.1.19)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    seo_meta (1.3.0)
      railties (>= 3.0.0)
    sprockets (2.1.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.6)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    truncate_html (0.5.5)
    tzinfo (0.3.33)
    uglifier (1.2.4)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)
    warden (1.1.1)
      rack (>= 1.0)
    will_paginate (3.0.3)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 3.2.1)
  jquery-rails
  rails (= 3.2.3)
  refinerycms (~> 2.0.0)
  refinerycms-i18n (~> 2.0.0)
  sass-rails (~> 3.2.3)
  sqlite3
  uglifier (>= 1.0.3)
user410925
  • 189
  • 1
  • 2
  • 8

2 Answers2

0

You can safely ignore the invalid gemspec errors, it's just a date formatting issue that should not affect you. Regarding gem versions, can you post the content of your Gemfile? I think it'll only be a matter of putting a version next to your gems. See http://gembundler.com/gemfile.html

EDIT: I'm not sure this will solve the problem, but you should remove the = in your Gemfile. Here's how it should look:

enter code heregem 'refinerycms', '0.9.6.34'

Same thing for other gems where you're using this syntax

Oscar Del Ben
  • 4,485
  • 1
  • 27
  • 41
  • Thanks, the Gemfile looks like: source 'http://rubygems.org' gem 'refinerycms', '= 0.9.6.34' gem 'rails', '~> 2.3.14' gem 'mysql2', '~> 0.2.18' gem 'hpricot' gem 'rmagick', '= 2.12.2' Bundle install now works (i've removed the ubuntu package and install gems from source), but rails server leads to the following error: Exiting /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load': /home/bcyde/refinerytest/merged/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError) – user410925 Jun 25 '12 at 15:36
  • can you post it again in the question body so I can see the formatting? Regarding you syntax error, you may want ot post the content of session_store too (without the secret key!) – Oscar Del Ben Jun 25 '12 at 15:42
  • Hi Oscar, where would session_store be? I have a config/initializers/session_store.rb and its contents are: # Be sure to restart your server when you modify this file. Merged::Application.config.session_store :cookie_store, key: '_merged_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") # Merged::Application.config.session_store :active_record_store – user410925 Jun 25 '12 at 16:44
0

There are several factors to consider:

1) Ruby Version : Make sure you Heroku setup is using 1.8.7 so that you can replicate the current system 'as is'. The "current" stack for Heroku (Cedar) is using 1.9.3 so make sure you get an older heroku stack that still supports ruby 1.8.7
Make sure you install and start using RVM to manage your ruby versions. This is what most people use for that and is strongly recommended to avoid painful issues.

2) Rails Version: I see Rails 2.3.2 listed in your Gemfile list. This is a very 'current' version of rails which is great. You should be aware though, that with this, or the next minor version of rails, Ruby 1.8.7 will not be supported (it's quite 'old' in open source land), so you'll need to also try and move to 1.9.3 asap. Without this you'll start to have endless gem issues and resolving them for old versions can be impractical, especially if you are newer to ruby and rails.

3) The Database. It sounds like you've imported that which is good as that can be a big issue. Not sure what you used - probably a sql dump or backup. Presumably you did this locally. For Heroku itself you use https://devcenter.heroku.com/articles/taps as you may already know.

The main thing is that your bundle completed ok.
99% of the time this means that your gems are ok too.

I would try running the app and seeing how it works.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • For the sake of being unbiased, rbenv is another option for managing Ruby versions. – coreyward Jun 25 '12 at 15:43
  • Thanks for your reply, as I posted above, bundle install seems to work now (after installing gems from source). However running "rails server" results in the error: /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load': /home/bcyde/refinerytest/merged/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError) ...sion_store :cookie_store, key: '_merged_session' ^ Any thoughts on how to resolve this? Thanks, – user410925 Jun 25 '12 at 15:47