Newbie-Question

Hi.
I’ve just started using Ruby on Rails.
Now I’ve got my first problem.

I generated a new migration ‘add_price’ and get the message:

                                                                                                                                                                                                                          D:\ruby\work\depot>rake 

db:migrate
(in D:/ruby/work/depot)
== AddPrice: migrating

– add_column(:products, :pice, :decimal, {:default=>0, :precision=>8,
:scale=>2
})
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
(See full trace by running task with --trace)
D:\ruby\work\depot>rake db:migrate --trace
(in D:/ruby/work/depot)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== AddPrice: migrating

– add_column(:products, :pice, :decimal, {:default=>0, :precision=>8,
:scale=>2
})
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_
adapters/abstract/schema_statements.rb:259:in type_to_sql' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/abstract/schema_statements.rb:122:inadd_column’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:273:in method_missing' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:257:insay_with_time’
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:257:insay_with_time’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:271:in method_missing' ./db/migrate//002_add_price.rb:3:inreal_up’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in migrate' d:/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:333:inmigrate’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:328:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:295:inup’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:286:in migrate' d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:inexecute’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in execute' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:ininvoke’
d:/ruby/lib/ruby/1.8/thread.rb:135:in synchronize' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:ininvoke’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in run' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:inrun’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
d:/ruby/bin/rake.bat:25

Any idea for the reason?

Thanks,

Juergen

You need ‘edgerails’ if you want to use the decimal column. Check the
AWDWR errata as it should mention something about it. Rails allows
you to have multiple versions of itself. You’d need to update to
edgerails for the Depot application only.

Stuart

You’d need to update to
edgerails for the Depot application only.

Can you tell me how to do this?

http://wiki.rubyonrails.org/rails/pages/EdgeRails
I chose the “easy way”. Just make sure you are in the depot directory
when you run the command.

Stuart

you’ll have to install subversion (svn). its a version control system.
for
more info and downloads, visit
http://subversion.tigris.org

2006/8/16, Juergen G. [email protected]:

** Execute rails:freeze:edge
d:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize’


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Michael S. [email protected]

www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium

On 8/16/06, Juergen G. [email protected] wrote:

ERROR: Must have subversion (svn) available in the PATH to lock this
application to Edge Rails rake aborted!
exit

If you have subversion /svn/ then make sure it’s in the environmental
path, otherwise, yes you’d need to install it.

S

http://wiki.rubyonrails.org/rails/pages/EdgeRails
I chose the “easy way”.

i just get another error message while starting the easy way

D:\ruby\work\depot>rake rails:freeze:edge --trace
(in D:/ruby/work/depot)
** Invoke rails:freeze:edge (first_time)
** Execute rails:freeze:edge
d:/ruby/bin/rake.bat: No such file or directory - svn --version
ERROR: Must have subversion (svn) available in the PATH to lock this
application to Edge Rails rake aborted!
exit
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/framework.rake:41:in
exit' d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/framework.rake:41 d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in execute’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in execute' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in invoke’
d:/ruby/lib/ruby/1.8/thread.rb:135:in synchronize' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in invoke’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in run' d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in run’
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
d:/ruby/bin/rake.bat:25
D:\ruby\work\depot>