我正在尝试使用我创建的Ruby gem(称为“ mygem ”)。但我的rails应用程序找不到它。有人可以建议为什么以及如何解决它?
第1步:验证我的当前目录中是否存在mygem:
$ pwd
/myDir
$ ls mygem-1.7.3.gem
-rw-r--r-- 1 myuser wheel 27136 Aug 6 11:41 mygem-1.7.3.gem
第2步:确保Gemfile说要从正确的位置拾取我的宝石:
$ grep mygem Gemfile
gem "mygem", :path => "/myDir"
第3步:执行bundle install
。
但是,当我这样做时,它说它无法找到它:
$ bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://gems.myserver.com/...
Fetching additional metadata from http://rubygems.org/....
Fetching additional metadata from http://gems.myserver.com/..
Resolving dependencies...
Could not find gem 'mygem (>= 0) ruby' in source at /myDir.
Source does not contain any versions of 'mygem (>= 0) ruby'