Fix migration for ruby 1.9. Move YAML check into application.rb, and add guard for ruby 1.8.x.
This commit is contained in:
parent
f0eeb17562
commit
ba9df59977
3 changed files with 10 additions and 8 deletions
|
|
@ -4,6 +4,14 @@
|
||||||
|
|
||||||
require File.expand_path('../boot', __FILE__)
|
require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
|
# Needed for versions of ruby 1.9.2 that were compiled with libyaml.
|
||||||
|
# They use psych by default which doesn't handle having a default set of parameters.
|
||||||
|
# See bug #1120.
|
||||||
|
require 'yaml'
|
||||||
|
if RUBY_VERSION.include? '1.9'
|
||||||
|
YAML::ENGINE.yamler= 'syck'
|
||||||
|
end
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
# If you have a Gemfile, require the gems listed there, including any gems
|
# If you have a Gemfile, require the gems listed there, including any gems
|
||||||
# you've limited to :test, :development, or :production.
|
# you've limited to :test, :development, or :production.
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,4 @@ rescue Bundler::GemNotFound => e
|
||||||
STDERR.puts e.message
|
STDERR.puts e.message
|
||||||
STDERR.puts "Try running `bundle install`."
|
STDERR.puts "Try running `bundle install`."
|
||||||
exit!
|
exit!
|
||||||
end if File.exist?(gemfile)
|
end if File.exist?(gemfile)
|
||||||
|
|
||||||
# Use older yaml parser to fix issues with
|
|
||||||
# db:create and db:migrate failing with empty database
|
|
||||||
# See bug #1120
|
|
||||||
require 'yaml'
|
|
||||||
YAML::ENGINE.yamler= 'syck'
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class DropAspectsOpen < ActiveRecord::Migration
|
class DropAspectsOpen < ActiveRecord::Migration
|
||||||
require 'db/migrate/20110202015222_add_open_to_aspects'
|
require File.join(Rails.root, "db", "migrate", "20110202015222_add_open_to_aspects")
|
||||||
def self.up
|
def self.up
|
||||||
AddOpenToAspects.down
|
AddOpenToAspects.down
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue