RAILS 3.0.x 安装plugin : install rails plugin for rails 3.0.x ( Commands is not a module (TypeError) )

访问量: 1358

今天在安装 rails 3.0.x 的plugin 时发现问题:   ( I met a problem when installing plugin for rails 3.0.x project) 

Commands is not a module (TypeError)

搜索了一下,这个是rake的BUG。  解决方法如下:  ( it seems it's a bug of Rake ) 

1. 编辑  Rakefile: 
  require File.expand_path('../config/application', __FILE__)
  require 'rake'
  # 增加这一行,注意位置。
  include Rake::DSL 
2.编辑: script/rails: 
  APP_PATH = File.expand_path('../../config/application',  __FILE__)
  require File.expand_path('../../config/boot',  __FILE__)
  # 增加这一行,注意位置。
  module Commands; end
  require 'rails/commands'
3.then run this command:
  $ bundle exec rails plugin install git://github.com/sbecker/asset_packager.git

refer to: http://stackoverflow.com/a/23507780/445908

订阅/RSS Feed

Subscribe

分类/category