0

I have local ruby gem, with a development version forked from github. So I have it locally. Now I want to use it in my application. I'm using bundler so I did:

gem 'otrs_connector', :path => '/devel/otrs_connector'

problem is that I get errors about missing files

require 'rubygems'
require 'otrs_connector'

then run

$ ruby app.rb 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- otrs_connector  (LoadError)

how can I load my "under development" gem?

this is my /devel/otrs_connector

$ ls -al /devel/otrs_connector
total 112
drwxr-xr-x  15 marcinkrzyzanowski  staff    510 Oct  1 15:22 .
drwxr-xr-x  33 marcinkrzyzanowski  staff   1122 Oct  1 15:17 ..
-rw-r--r--   1 marcinkrzyzanowski  staff     55 Oct  1 15:04 .document
drwxr-xr-x  13 marcinkrzyzanowski  staff    442 Oct  1 15:04 .git
-rw-r--r--   1 marcinkrzyzanowski  staff    820 Oct  1 15:04 .gitignore
-rw-r--r--   1 marcinkrzyzanowski  staff    480 Oct  1 15:04 Gemfile
-rw-r--r--   1 marcinkrzyzanowski  staff    773 Oct  1 15:04 Gemfile.lock
-rw-r--r--   1 marcinkrzyzanowski  staff   1054 Oct  1 15:04 LICENSE.txt
-rw-r--r--   1 marcinkrzyzanowski  staff   2016 Oct  1 15:04 README.rdoc
-rw-r--r--   1 marcinkrzyzanowski  staff   1428 Oct  1 15:04 Rakefile
-rw-r--r--   1 marcinkrzyzanowski  staff      5 Oct  1 15:04 VERSION
drwxr-xr-x   4 marcinkrzyzanowski  staff    136 Oct  1 15:04 lib
-rw-r--r--   1 marcinkrzyzanowski  staff  16896 Oct  1 15:22 otrs_connector-1.3.0.gem
-rw-r--r--   1 marcinkrzyzanowski  staff   2954 Oct  1 15:04 otrs_connector.gemspec
drwxr-xr-x   4 marcinkrzyzanowski  staff    136 Oct  1 15:04 test
4

1 回答 1

0

文件存储在哪里?我认为您将其存储在devel主文件夹中的文件夹中,而不是/devel. 如果以 开头的路径/,则指向 HD 路径的根。

您可能希望将路径更改为

gem 'otrs_connector', :path => '~/devel/otrs_connector'

(请注意~这是您的主文件夹路径的替代品)。

于 2012-10-01T13:36:05.087 回答