简体   繁体   中英

Modifying the Ransack gem

I am using the Ransack gem, but I want to modify it. So I am copying the Ransack gem folder from the C drive to the vendor/plugins/static_gem folder and try to edit it, but when I start the server it gives me error as:

    D:/Shrikant/Ruby Projects/fIT_Arms/vendor/static_gem/ransack-0.7.0/ransack.gemsp
     ec:25:in ``': No such file or directory - git ls-files (Errno::ENOENT)
     from D:/Shrikant/Ruby Projects/fIT_Arms/vendor/static_gem/ransack-0.7.0/
     ransack.gemspec:25:in `block in <main>'

          from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1368:
    in `initialize'
            from D:/Shrikant/Ruby Projects/fIT_Arms/vendor/static_gem/ransack-0.7.0/ransac

k.gemspec:5:in `new'
        from D:/Shrikant/Ruby Projects/fIT_Arms/vendor/static_gem/ransack-0.7.0/ransack.gemspec:5:in `<main>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:280:in `eval'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:280:in `rescue in block in load_gemspec'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:275:in `block in load_gemspec'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:273:in `chdir'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:273:in `load_gemspec'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:340:in `block in load_spec_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:339:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:339:in `load_spec_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:372:in `local_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:430:in `block in converge_locked_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:419:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:419:in `converge_locked_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:180:in `resolve'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:172:in `specs_for'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:161:in `requested_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/environment.rb:23:in `requested_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/runtime.rb:11:in `setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:107:in `setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/setup.rb:7:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from D:/Shrikant/Ruby Projects/fIT_Arms/config/boot.rb:6:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from script/rails:5:in `<main>'

It gives me an error at these lines

s.files         = `git ls-files`.split("\n")
  s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
  s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
  s.require_paths = ["lib"]

What can I do?

not sure if this is the issue but try removing the space in your path "D:/Shrikant/Ruby Projects/fIT_A" and try again

ie rename folder Ruby Projects to ruby_projects..

What is your dev environment

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM