English 中文(简体)
未能装载烟灰,使用国际船舶和船舶登记局采用的方法
原标题:Failed to load ruby gem, using require method in IRB

i ve制造了我自己的垃圾,但当我在当地机器中尝试时,有点令人厌恶,即ve角周围和另一个StackOverflow问题,但仍未找到解决这一问题的办法。

如果在后使用非专用用户<>irb 查询我_own_gem i ve got:

LoadError: no such file to load -- my_own_gem
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require 
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require 
    from (irb):2
    from (null):0

但是,在使用根基用户时,用 su子ir子看问题,一切都看着科索沃。

gem list -d my_own_gem

my_own_gem (0.0.1)
    Author: Jane Doe
    Rubyforge: http://rubyforge.org/projects/my_own_gem
    Homepage: google.com
    Installed at: /var/lib/gems/1.8

    lorem ipsum dolor sit amet

http://www.ohchr.org。

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

bashrc

export GEM_HOME=/var/lib/gems/1.8
export GEM_PATH=/var/lib/gems/1.8

my_own_gem.gemspec

# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "my_own_gem/version"

Gem::Specification.new do |s|
  s.name        = "my_own_gem"
  s.version     = MyOwnGem::VERSION
  s.platform    = Gem::Platform::RUBY
  s.authors     = ["Jane Doe"]
  s.email       = ["j4n3d0e@gmail.com"]
  s.extra_rdoc_files = ["MIT-LICENSE","README.rdoc"]
  s.rdoc_options = ["--charset=UTF-8"]
  s.homepage    = "google.com"
  s.summary     = %q{lorem ipsum}
  s.description = %q{lorem ipsum dolor sit amet}
  s.date = Time.now.utc.strftime("%A, %d% %B %Y")
  s.rubyforge_project = "my_own_gem"

  s.add_dependency "httparty", "= 0.7.8"

  s.post_install_message = "my own gem"

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

end
问题回答

添加贵方的书目

export RUBYOPT="rubygems"

或试图在<代码>/usr/lib/ruby/gems/1.8.上安装贵重体。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签