2011-08-18 13 views
5

मैं एक प्लगइन के रूप में यह स्थापित करने के लिए कोशिश कर रहा हूँ:रेल 3 में एक प्लगइन स्थापित करने के लिए, एक आदेश हो रही एक मॉड्यूल नहीं है (लेखन त्रुटि)

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 सही है। कंक्रीट समाधान है (यदि आप रेक 3.0.2 के साथ रेल 3.0.9 का उपयोग करते हैं, तो आपको 'रेक' की आवश्यकता के बाद रेक :: डीएसएल को रेकैकाइल में शामिल करना चाहिए। फिर मॉड्यूल कमांड जोड़ें; स्क्रिप्ट/रेल की आवश्यकता से पहले 'रेल/आदेशों', आप नहीं मिलेगा त्रुटि संदेश किसी भी अधिक) 'आदेश एक मॉड्यूल (लेखन त्रुटि) नहीं है':।

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 

प्लगइन स्थापित किया जाएगा।

संबंधित मुद्दे