2009-11-20 88 views
4

我部署我的Rails應用到Linux服務器和我有一些rake任務丟失計有耙寶石:安裝和耙分貝如何建設任務「寶石:安裝」

我運行軌道2.3.4來自創業板。

這是爲什麼?

我該如何解決這個問題?我可以更新嗎?


他們是從耙-T列表中缺少

rake apache2     # Build Apache 2 module 
rake clean      # Remove compiled files 
rake clobber     # Remove all generated files 
rake default     # Build everything 
rake doc      # Generate all documentation 
rake doxygen     # Generate Doxygen C++ API documentation if ... 
rake doxygen:clobber   # Remove generated Doxygen C++ API documenta... 
rake doxygen:force    # Force generation of Doxygen C++ API docume... 
rake fakeroot     # Create a fakeroot, useful for building nat... 
rake nginx      # Build Nginx helper server 
rake package     # Build all the packages 
rake package:clean    # Remove package products 
rake package:debian   # Create a Debian package 
rake package:force    # Force a rebuild of the package files 
rake package:gem    # Build the gem file passenger-2.2.4.gem 
rake rdoc      # Build the rdoc HTML Files 
rake rdoc:clobber    # Remove rdoc products 
rake rdoc:force    # Force a rebuild of the RDOC files 
rake sloccount     # Run 'sloccount' to see how much code Passe... 
rake test      # Run all unit tests and integration tests 
rake test:cxx     # Run unit tests for the Apache 2 and Nginx ... 
rake test:integration   # Run all integration tests 
rake test:integration:apache2 # Run Apache 2 integration tests 
rake test:integration:nginx # Run Nginx integration tests 
rake test:oxt     # Run unit tests for the OXT library 
rake test:rcov     # Run coverage tests for the Ruby libraries 
rake test:restart    # Run the 'restart' integration test infinit... 
rake test:ruby     # Run unit tests for the Ruby libraries 

我耙文件包含此:

# Add your own tasks in files placed in lib/tasks ending in .rake, 
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 

require(File.join(File.dirname(__FILE__), 'config', 'boot')) 

require 'rake' 
require 'rake/testtask' 
require 'rake/rdoctask' 

require 'tasks/rails' 

如何添加寶石和db耙任務嗎?爲什麼他們錯過了?

回答

6

什麼是rake -T輸出?這應該列出所有可用的任務。在RoR應用程序中,Rakefile定義您的任務。

可以使用gem update更新的寶石。

0

你可以嘗試更新的Rails安裝,或通過將--force標誌完全重新安裝護欄。你有沒有其他項目可以使用這個命令?檢查這些項目中的rake文件。它看起來像你的RAKEFILE是一樣的,儘管...這個項目最初是基於一個老版本的軌道?你正在運行什麼寶石版本?您可能需要執行gem update --system。所有這些都是可能的。

+0

喜盧卡斯 我剛纔跑創業板安裝導軌--no裏--no-的RDoc --force但仍下落不明rake任務分貝和寶石等 的話,我已經跑寶石更新--system和它說沒有更新。 是的,這個項目是基於rails 2.3.3創建的,但已經更新到2.3.4,並且在GEM中沒有任何東西在運行。 任何想法? 非常感謝 – 2009-11-20 14:01:23

+0

剛剛在我的服務器上創建了一個新的Rails應用程序,它具有所有的Rake任務。這是怎麼回事!!!!! – 2009-11-20 14:06:03

+0

只要注意到你有問題用capistrano標記。可能檢查以確保cap沒有定義自己的rake任務而沒有連接到rails。 – Lukas 2009-11-20 14:17:20

0

我想你總是可以重新創建項目。討厭但總是似乎幫助最壞的情況。

至少這會給你的它是否是某種依賴問題的項目或某事的想法。

4

檢查Capfile,如果你實際上運行寶石:從Capistrano的安裝。顯然,這樣做的方法是確保您在運行Capistrano時在內部正確的目錄中。

namespace :gems do 
    desc "Install gems" 
    task :install, :roles => :app do 
    run "cd #{current_path} && #{sudo} rake RAILS_ENV=production gems:install" 
    end 
end 

您也可以始終指定Rakefile,以確保在rake命令前面使用-f [FILE]選項。

0

如果您使用的是Rails應用程序,您還可以在LIB /任務定義rake任務/ SOME_TASK.rake

,如果你定義SOME_TASK那麼它會顯示出來,當你運行rake -T,並可用命令。