2011-09-01 95 views
0
[email protected]:~/sites/QandA$ rake db:create 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/version.rb:4: warning: already initialized constant MAJOR 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/version.rb:5: warning: already initialized constant MINOR 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/version.rb:6: warning: already initialized constant BUILD 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/version.rb:3: warning: already initialized constant NUMBERS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/version.rb:9: warning: already initialized constant VERSION 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake.rb:26: warning: already initialized constant RAKEVERSION 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/early_time.rb:17: warning: already initialized constant EARLY 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/alt_system.rb:32: warning: already initialized constant WINDOWS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/application.rb:28: warning: already initialized constant DEFAULT_RAKEFILES 
WARNING: Possible conflict with Rake extension: String#ext already exists 
WARNING: Possible conflict with Rake extension: String#pathmap already exists 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/task_arguments.rb:73: warning: already initialized constant EMPTY_TASK_ARGS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/invocation_chain.rb:49: warning: already initialized constant EMPTY 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/dsl_definition.rb:143: warning: already initialized constant Commands 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:44: warning: already initialized constant ARRAY_METHODS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:47: warning: already initialized constant MUST_DEFINE 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:51: warning: already initialized constant MUST_NOT_DEFINE 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:55: warning: already initialized constant SPECIAL_RETURN 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:61: warning: already initialized constant DELEGATING_METHODS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:364: warning: already initialized constant DEFAULT_IGNORE_PATTERNS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake/file_list.rb:370: warning: already initialized constant DEFAULT_IGNORE_PROCS 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake.rb:64: warning: already initialized constant FileList 
/home/sahil/.rvm/gems/[email protected]/gems/rake-0.9.2/lib/rake.rb:65: warning: already initialized constant RakeFileUtils 
WARNING: Global access to Rake DSL methods is deprecated. Please include 
... Rake::DSL into classes and modules which use the Rake DSL methods. 
WARNING: DSL method QandASite::Application#task called at  /home/sahil/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks' 
rake aborted! 
stack level too deep 

I M使用無法創建使用耙DB數據庫:創建

[email protected]:~/sites/QandA$ ruby -v 
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux 
[email protected]:~/sites/QandA$ rails -v 
Rails 3.0.1 
[email protected]:~/sites/QandA$ rvm -v 
rvm 1.8.0 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/] 

寶石文件

source 'http://rubygems.org' 

gem 'rails', '3.0.1' 

# Bundle edge Rails instead: 
#  gem 'rails', :git => 'git://github.com/rails/rails.git' 
gem 'rake' 
gem 'mysql2','0.2.7' 
gem 'heroku' 
# Use unicorn as the web server 
#  gem 'unicorn' 

# Deploy with Capistrano 
#  gem 'capistrano' 

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) 
#  gem 'ruby-debug' 
#  gem 'ruby-debug19', :require => 'ruby-debug' 

# Bundle the extra gems: 
#  gem 'bj' 
#  gem 'nokogiri' 
#  gem 'sqlite3-ruby', :require => 'sqlite3' 
#  gem 'aws-s3', :require => 'aws/s3' 

# Bundle gems for the local environment. Make sure to 
# put test-only gems in this group so their generators 
# and rake tasks are available in development mode: 
# group :development, :test do 
#  gem 'webrat' 
# end 
+0

使用Google進行搜索時會發現寶石存在某些問題。將Gemfile添加到問題中,可能會有所幫助。 – lucapette

+0

我有一個類似的問題,並使用http://stackoverflow.com/questions/7227017/rake-dbcreate-not-working解決這個問題的答案。寶石卸載rake -a想知道是否有更好的解決方案? – jwieringa

+0

@jwieringa其不工作已經嘗試:( –

回答

0

嘗試運行

bundle exec rake db:create 

有時能解決怪異的問題。