2011-08-18 5 views
5

私はプラグインとしてこれをインストールしようとしています:、コマンドを取得するモジュール(TypeError例外)ではありません

https://github.com/phatworx/rack_ip_restrictor 

だから私は実行します。

$ rails plugin install git://github.com/phatworx/rack_ip_restrictor.git 

このエラーは次の原因で発生します。

/Users/userme/.rvm/gems/[email protected]/gems/railties-3.0.5/lib/rails/commands/plugin.rb:277:in `<top (required)>': Commands is not a module (TypeError) 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require' 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in' 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/userme/.rvm/gems/[email protected]/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/userme/.rvm/gems/[email protected]/gems/railties-3.0.5/lib/rails/commands.rb:17:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

提案、アイデア?おかげ

答えて

0

あなたはレール3.0.10にしようとしています。実際に3.0.10で動作するはずです!

1

@acconradが正しいです。具体的な解決策は(rake 0.9.2でレール3.0.9を使用する場合は、require 'rake'の直後にRakefileにinclude Rake :: DSLを追加する必要があります) モジュールコマンドを追加し、requireの直前でスクリプト/ 'レール/コマンド'、あなたが取得することはありません任意のより多くのエラーメッセージ 'コマンドをモジュール(TypeError例外)ではありません'):。

1.in Rakefile、

require File.expand_path('../config/application', __FILE__) 
require 'rake' 
# add this line of code 
include Rake::DSL 

2.inスクリプト/レール:

APP_PATH = File.expand_path('../../config/application', __FILE__) 
require File.expand_path('../../config/boot', __FILE__) 
# add this line of code 
module Commands; end 
require 'rails/commands' 

3.thenこのコマンドを実行します。

$ bundle exec rails plugin install git://github.com/sbecker/asset_packager.git 

プラグインがインストールされます。

関連する問題