找不到RubyGem rake

时间:2012-04-10 18:13:36

标签: ruby-on-rails capistrano

sh -c 'cd /home/xyz/xyz.com/releases/20120410180718 &&
/home/xyz/.gems/bin/rake RAILS_ENV=production RAILS_GROUPS=assets
assets:precompile' [out ::] /usr/lib/ruby/1.8/rubygems.rb:779:in
`report_activate_error' [out ::] : Could not find RubyGem rake (>= 0)
(Gem::LoadError [out ::] ) [out ::] from
/usr/lib/ruby/1.8/rubygems.rb:214:in `activate' [out ::] from
/usr/lib/ruby/1.8/rubygems.rb:1082:in `gem' [out ::] from
/home//.gems/bin/rake:18

我正在使用 cap deploy:migrations 命令 请帮忙。

这是我的Gemfile

source 'https://rubygems.org'

gem 'rails'
gem "mysql2", "~> 0.3.11"
gem "rake"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
   gem 'compass-rails'
   gem 'sass-rails',   '~> 3.2.3'
   gem 'haml'
   gem 'haml-rails'
   gem 'coffee-rails', '~> 3.2.1'
   gem 'uglifier', '>= 1.0.3'
end

#Media managment
gem 'carrierwave'
gem 'ruby_parser'
gem 'hpricot'


# deployment 
gem 'capistrano'

在服务器端

[ps89405]$ rake --version
rake, version 0.9.2.2

更新

运行与服务器无限制相同的命令工作!

[ps89405]$ cd /home//.com/releases/20120410183344 &&    /home//.gems/bin/rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
[ps89405]$ 

更新: 我补充道     要求“bundler / capistrano”

到我的deploy.rb

现在我已经发出了这个问题

使用此命令

  cd /home/.com/releases/20120410201511 && bundle install --gemfile 
     

/home/.com/releases/20120410201511/Gemfile --path   /home/.com/shared/bundle --demployment --quiet    - 没有开发测试

如果我使用上限命令,我会

bundle: command not found

当我在服务器上手动运行它时工作正常!

1 个答案:

答案 0 :(得分:0)

您是否在部署目的地上完成了bundle install?该错误似乎意味着您的软件包未安装。

Could not find RubyGem rake (>= 0)表示take正在未安装rake gem的上下文中运行。