安装Local Gem Rails 4.2

时间:2016-09-03 22:06:38

标签: ruby-on-rails ruby-on-rails-4

好吧所以我有一个宝石文件是本地的。在我的rails应用程序中,gem spec文件和创建的gem以及捆绑的所有文件位于:

vendor/gems/mygem

在我的Gemfile中我有

gem 'mygem-1.0', :path => 'vendor/gems/mygem'

当我跑步时:

bundle install

我收到错误:

Could not find gem 'mygem-1.0 x86-mingw32' in source at 'vendor/gems/mygem' in source at 'vendor/gems/mygem/'.
Source does not contain any version of 'mygem-1.0 x86-mingw32'

1 个答案:

答案 0 :(得分:0)

好吧,休息几分钟后。我注意到我实际上是将gem的版本号称为gem名称的一部分:

# What I originally Had
gem 'mygem-1.0', :path 'vendor/gems/mygem'

# What it should be
gem 'mygem', :path 'vendor/gems/mygem'

bundler自动将版本号添加到gem中,我认为这是文件名的一部分,并且在gemfile本身内部指定了版本。