我在'gemz'文件夹中创建了一个简单的自定义gem,并在gemfile中配置('checkpercentage','〜> 0.1.0'),它在我的应用程序中运行正常,但无法将其部署到heroku。
尝试将更新推送到Heroku的主分支时出现以下错误。
我的Ruby版本: ruby 2.1.1p76(2014-02-24修订版45161)[i686-linux]
错误:
nci@nci-VirtualBox:~/Zacchi/kuizu$ git push heroku master
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.7.12
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote: You have added to the Gemfile:
remote: * source: source at /home/nci/Zacchi/kuizu/gemz
remote: You have deleted from the Gemfile:
remote: * source: source at gemz
remote: Bundler Output: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: You have added to the Gemfile:
remote: * source: source at /home/nci/Zacchi/kuizu/gemz
remote:
remote: You have deleted from the Gemfile:
remote: * source: source at gemz
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to safe-waters-3501.
remote:
的Gemfile:
source 'https://rubygems.org'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
gem 'devise'
gem 'checkpercentage', '~>0.1.0', :path => "/home/nci/Zacchi/kuizu/gemz"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
.... more gems ...
这些是我试图解决这个问题但到目前为止没有运气的事情:
感谢任何帮助!
答案 0 :(得分:1)
当Heroku“读取”/home/nci/Zacchi/kuizu/gemz
(或任何其他本地参考)时,它不知道去哪里。您需要publish your gem并从Gemfile中删除本地引用。