Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rake db:migrate not working

Status
Not open for further replies.

metaltree

Technical User
Nov 27, 2006
28
CA
Hello.

When I use rake bd:migrate, it sends this:

Code:
C:\testror\depot>rake db:migrate --trace
c:/ruby/bin/rake.bat:24: undefined method `require_gem' for main:Object (NoMetho
dError)

Any clue?
 
Sounds like you may not have everything installed properly. How did you install your ruby/gem/RoR/rake setup?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Okay, the problem was the missing rake command apparently. I reinstalled it.

But now, I can't get passed that new problem:

Code:
C:\testror\depot>rake db:migrate --trace
(in C:/testror/depot)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
182: Le systÞme d'exploitation ne peut pas exÚcuter %1.   - c:/ruby/lib/ruby/gem
s/1.8/gems/ruby-postgres-0.7.1.2006.04.06-mswin32/./postgres.so
c:/ruby/lib/ruby/gems/1.8/gems/ruby-postgres-0.7.1.2006.04.06-mswin32/./postgres
.so
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependenci
es.rb:496:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependenci
es.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependenci
es.rb:496:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/k
ernel/requires.rb:7:in `require_library_or_gem'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/k
ernel/reporting.rb:11:in `silence_warnings'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/k
ernel/requires.rb:5:in `require_library_or_gem'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a
dapters/postgresql_adapter.rb:7:in `postgresql_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a
dapters/abstract/connection_specification.rb:291:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a
dapters/abstract/connection_specification.rb:291:in `connection='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a
dapters/abstract/connection_specification.rb:259:in `retrieve_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a
dapters/abstract/connection_specification.rb:78:in `connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/migration.rb
:294:in `migrate'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/databases.rake:85
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_c
hain'
c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_c
hain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
c:/ruby/bin/rake:19:in `load'
c:/ruby/bin/rake:19

C:\testror\depot>

I tried to revert back from Rails v2.0.2 to v1.2.3 using:
Code:
gem install rails -v 1.2.3
And then changing the version variable RAILS_GEM_VERSION in C:\testror\depot\config\environment.rb to 1.2.3 as well, but the problem persists.

Any more clue?








 
If you are running the 'depot' application from Agile Web Development with Rails it doesn't work with Rails 2.x without a bit of modification. The jury is still out on whether it is easier to follow the book verbatim with 1.x, and then re-learn things that have changed for 2.x, or just try to go straight to 2.x and use the book as a guide.

You might get more help on this Ruby forum doesn't get much activity...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Okay, thanks.

Yes, I agree, there doesn't seem to be a lot of activity here!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top