【问题标题】:Fail to deploy rail app to heroku (error while installing linecache19 (0.5.12)无法将 rail 应用程序部署到 heroku(安装 linecache19 (0.5.12) 时出错)
【发布时间】:2013-02-03 18:58:28
【问题描述】:

我正在尝试将我的铁路应用程序上传到 Heroku。我正在使用 Ruby 1.9.3。 该应用程序可以在我的本地计算机上正常部署。

 An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
   Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

我尝试将这一行输入到 Gemfile

gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'

但这似乎并没有解决问题。

有人可以建议吗?提前感谢您的帮助。 p.s.:对于新手的问题真的很抱歉,我在 Ruby on Rails 开发方面还很新。

以下是我完整的 Gemfile


source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

# for Heroku deployment - as described in Ap. A of ELLS book
group :development, :test do
 gem 'sqlite3'
 gem 'ruby-debug19', :require => 'ruby-debug'
end
group :production do
 gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
 gem 'therubyracer'              
 gem 'sass-rails', "  ~> 3.1.0"
 gem 'coffee-rails', "~> 3.1.0"
 gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
gem 'haml'

gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

    linecache19 是一个用于调试目的的 gem。生产中不需要它,因此您应该将其从生产中使用的 gem 中排除。

    将其添加到文件顶部已有的:development, :testbundle,然后重新部署。

    group :development, :test do
      gem 'sqlite3'
      gem 'ruby-debug19', :require => 'ruby-debug'
      gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
    end
    

    【讨论】:

    • 感谢您的回复@Deefour,我已将其移至开发、测试组,然后执行 bundle install git push heroku master 但我仍然收到相同的错误。您能否提一些建议 ? - 谢谢
    • 您是否将新的GemfileGemfile.lock 提交给heroku?推送到heroku成功了吗?除了您忘记提交更改或推送错误之外,我认为部署没有理由再次尝试构建 linecache19
    • 此外,您可能还需要设置一个配置标志以不安装测试或开发 gem:$ heroku config:add BUNDLE_WITHOUT="test development" --app app_name 更多信息:blog.johnfnixon.com/using-rails-3x-with-heroku
    • @Deefour 感谢您的帮助,在我重新提交所有内容并重新部署到 heroku 后,它现在可以工作了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-26
    • 1970-01-01
    • 2015-09-22
    • 2017-09-14
    • 2015-12-09
    • 2020-04-06
    相关资源
    最近更新 更多