2012-03-31 67 views
10

我克隆使用Rails 3.1.3我自己的應用程序之一,在堆雪松在Heroku上創建一個應用程序,推到Heroku的,然後試圖運行的Heroku:沒有找到Rake文件(但在本地工作)

heroku run rake db:migrate而得到這個錯誤消息

No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) 
/usr/local/lib/ruby/1.9.1/rake.rb:2367:in `raw_load_rakefile' 
/usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile' 
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' 
/usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile' 
/usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run' 
/usr/local/bin/rake:31:in `<main> 

我在應用程序的根,當我運行rake db:migrate。該應用程序在本地主機上工作。

任何想法我可能做錯了什麼?

我注意到,似乎很奇怪的唯一的事情是,在錯誤消息,它引用ruby/1.9.1/

不過,我創建了使用RVM紅寶石1.9.2應用程序,當我做ruby -v

ruby -v 
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] 

我的Gemfile

source 'http://rubygems.org' 

gem 'rails', '3.1.3' 

# Bundle edge Rails instead: 
# gem 'rails',  :git => 'git://github.com/rails/rails.git' 

group :development, :test do 
    gem 'sqlite3' 
end 
group :production do 
    gem 'pg' 
end 

group :production do 
    gem 'thin' 
end 

gem "heroku" 

gem 'omniauth-facebook' 
gem 'omniauth' 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.1.5' 
    gem 'coffee-rails', '~> 3.1.1' 
    gem 'uglifier', '>= 1.0.3' 
end 

gem "rmagick" 
gem "carrierwave" 
gem 'fog' 
gem 'simple_form' 

gem 'devise' 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 

group :test do 
    # Pretty printed test output 
    gem 'turn', '0.8.2', :require => false 
end 

我gitignore文件

# See http://help.github.com/ignore-files/ for more about ignoring files. 
# 
# If you find yourself ignoring temporary files generated by your text editor 
# or operating system, you probably want to add a global ignore instead: 
# git config --global core.excludesfile ~/.gitignore_global 

# Ignore bundler config 
/.bundle 

# Ignore the default SQLite database. 
/db/*.sqlite3 

# Ignore all logfiles and tempfiles. 
/log/*.log 
/tmp 
+0

這是很正常的,目錄名爲1.9.1。你Rakefile的任何機會沒有被檢入你的倉庫?也許手動排除? – iltempo 2012-03-31 20:32:04

+0

我在OP中發佈了一份gitignore文件。我可以從我的app目錄打開rake文件。但是,我不知道如何檢查rake文件是否推送到heroku。你知道嗎? – Leahcim 2012-03-31 21:19:55

+0

bash進入dyno並查看: 'heroku run bash' 'cd/app /' – 2012-03-31 22:15:02

回答

28

您必須推送到主分支。從看上面的評論看起來你沒有這樣做。

因此,假設你正在開發的主分支您的應用程序,你可以用一個簡單的部署:

git push heroku master 

如果你不是主發展與部署:

git push heroku your_branch_name:master 

將your_branch_name替換爲您正在使用的分支的名稱。

相關問題