Bugs: Browse | Submit New | Admin

[#8278] MiniCMS Demo Migration Error

Date:
2007-01-29 11:26
Priority:
3
Submitted By:
Daniel Weinand (dweinand)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
MiniCMS Demo Migration Error

Detailed description

Hi, I'm doing the MiniCMS tutorial. When I attempted to do at the miniCMS root directory:

rake db:migrate:engines

I received a rake invalid constant error. Below is the trace.

Help! Thanks. (in C:/InstantRails/rails_apps/minicms) ** Invoke db:migrate:engines (first_time) ** Invoke environment
(first_time) ** Execute environment ** Execute db:migrate:engines Migrating engine 'active_rbac' == ImportActiveRbacSchema?:
migrating ========================================== rake aborted! Invalid argument -
/C:/InstantRails/rails_apps/minicms/C:/InstantRails/rails_apps/minicms/config/../vendor/plugins/active_rbac/db/migrate
C:/InstantRails/ruby/lib/ruby/1.8/pathname.rb:341:in `lstat' C:/InstantRails/ruby/lib/ruby/1.8/pathname.rb:341:in `realpath'
C:/InstantRails/rails_apps/minicms/config/../vendor/plugins/active_rbac/db/migrate/001_import_active_rbac_schema.rb:6:in
`real_up' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:210:in `migrate'
C:/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:210:in `migrate'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:332:in `migrate'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:327:in `migrate'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:294:in `up'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:285:in `migrate'
./vendor/plugins/engines/tasks/engines.rake:80 ./vendor/plugins/engines/tasks/engines.rake:75
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'
C:/InstantRails/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 C:/InstantRails/ruby/bin/rake.bat:25

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-01-29 11:28
Sender: Daniel Weinand

2/07/06 06:10:59: Modified by binladin@mail.ru

    * type changed from defect to enhancement.
    * version changed from 0.3.1 to 0.3.2.
    * component changed from controllers to documentation.

You try demo on win32 platform ? If yes, try folowing path to
pathname.rb http://dev.rubyonrails.org/ticket/5285 I am simply
create file: %RUBY%\lib\activesupport-1.3.1\lib\active_support\co
re_ext\pathname\win32_fix.rb with content:
#--------------------------------------------------- class Pathname
#:nodoc:

    # # Returns a real (absolute) pathname of +self+ in the actual
filesystem. # The real pathname doesn't contain symlinks or useless
dots. # # Because Pathname library is written for unix-style
pathnames, this is a # fix for detecting absolute pathnames #
def realpath(*args)

        unless args.empty?

            warn "The argument for Pathname#realpath is
obsoleted."

        end force_absolute = args.fetch(0, true)

        is_absolute = %r{\A/} top = '/' # Win32 detection if
RUBY_PLATFORM =~ /(?:mswin|mingw|bccwin)32/

            is_absolute = %r{\A[A-Za-z]:/\\} top =

        end if is_absolute =~ @path

            unresolved = @path.scan(%r{[/]+})

        elsif force_absolute

            # Although POSIX getcwd returns a pathname which
contains no symlink, # 4.4BSD-Lite2 derived getcwd may return
the environment variable $PWD # which may contain a symlink.
# So the return value of Dir.pwd should be examined. unresolved
= Dir.pwd.scan(%r{[/]+}) + @path.scan(%r{[/]+})

        else

            top = unresolved = @path.scan(%r{[/]+})

        end resolved = []

        until unresolved.empty?

            case unresolved.last when '.'

                unresolved.pop

            when '..'

                resolved.unshift unresolved.pop

            else

                loop_check = {} while (stat = File.lstat(path
= top + unresolved.join('/'))).symlink?

                    symlink_id
= "#{stat.dev}:#{stat.ino}"

                    raise Errno
                        ELOOP.new(path) if loop_check[symlink_id]
loop_check[symlink_id] = true if %r{\A/} =~ (link =
File.readlink(path)) top = '/' unresolved = link.scan(%r{[/]+})
else unresolved[-1,1] = link.scan(%r{[/]+}) end end next if (filename
= unresolved.pop) == '.' if filename != '..' && resolved.first
== '..' resolved.shift else resolved.unshift filename end end end

        if top == '/'

            resolved.shift while resolved[0] == '..'

        end if resolved.empty?

            Pathname.new(top.empty? ? '.' : '/')

        else

            Pathname.new(top + resolved.join('/'))

        end

    end end #----------------------------------------------

and put the string: require File.dirname(FILE) + '/pathname/win32_fix'
into file: %RUBY%\lib\activesupport-1.3.1\lib\active_support\core
_ext\pathname.rb

And i have working active_rbac after: rake db:migration:engine

Attached Files:

Name Description Download
win32_fix.rb Download

Changes:

Field Old Value Date By
File Added1186: win32_fix.rb2007-01-29 11:28dweinand