- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 RoR 的初学者,我正在尝试将我的第一个应用程序部署到 Heroku。我们正在使用 GitHub 作为存储库,并且在尝试使用“git push heroku master”进行部署时不断出现错误
请看下面我们运行时收到的消息..
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 69, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (69/69), 26.38 KiB, done.
Total 69 (delta 5), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.3)
Installing i18n (0.6.1)
Installing multi_json (1.6.0)
Installing activesupport (3.2.11)
Installing builder (3.0.4)
Installing activemodel (3.2.11)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.5)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.2.2)
Installing actionpack (3.2.11)
Installing mime-types (1.21)
Installing polyglot (0.3.3)
Installing treetop (1.4.12)
Installing mail (2.4.4)
Installing actionmailer (3.2.11)
Installing arel (3.0.2)
Installing tzinfo (0.3.35)
Installing activerecord (3.2.11)
Installing activeresource (3.2.11)
Installing coffee-script-source (1.4.0)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.3)
Installing json (1.7.7)
Installing rdoc (3.12.1)
Installing thor (0.17.0)
Installing railties (3.2.11)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.2.1)
Using bundler (1.3.0.pre.5)
Installing rails (3.2.11)
Installing sass (3.2.5)
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_1um81jm55kdnc/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7 for inspection.
Results logged to /tmp/build_1um81jm55kdnc/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:aqueous-tor-8402.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:aqueous-tor-8402.git'
我的gem文件如下:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
当我运行“sqlite3 -version 我得到:
3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af
当我执行“bundle show sqlite3”时,我得到:
/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.7
抱歉各位,这是我的第一个 Rails 应用,所以我对这方面比较陌生。
如有任何帮助,我们将不胜感激。
更新:这是 Heroku 日志
$ heroku logs
2013-02-12T22:04:25+00:00 heroku[api]: Enable Logplex by peterbarbosa1@gmail.com
2013-02-12T22:04:25+00:00 heroku[api]: Release v2 created by peterbarbosa1@gmail.com
2013-02-12T22:04:47+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T22:04:46+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T22:41:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:42:39+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T22:45:56+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:46:30+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T22:59:31+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:59:52+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:00:39+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T23:00:39+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T23:08:25+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:08:50+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:13:09+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:13:45+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:18:14+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:18:41+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:20:03+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:20:34+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:22:39+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:23:05+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:25:50+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:26:37+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:28:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:29:20+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:31:20+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:32:01+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:42:41+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:43:08+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:48:22+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:48:47+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:52:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:53:16+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T00:08:04+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:08:04+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=pbarbosa.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=pbarbosa.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code=H16 desc="herokuapp redirect" method=GET path=/ host=pbarbosa.heroku.com fwd="99.250.119.144" dyno= queue= wait= connect= service= status=301 bytes=
2013-02-13T00:19:18+00:00 heroku[slugc]: Slug compilation started
2013-02-13T00:19:41+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T00:39:17+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_AQUA resource by peterbarbosa1@gmail.com
2013-02-13T00:39:17+00:00 heroku[api]: Release v3 created by peterbarbosa1@gmail.com
2013-02-13T01:27:38+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:27:59+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:29:28+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:29:52+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:31:32+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:32:01+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:32:30+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:32:55+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
最佳答案
Heroku 不支持 sqlite 数据库。您需要使用 postgres在生产中。在 Rails 中,切换数据库很容易:
group :production do
gem "pg"
end
group :development, :test do
gem "sqlite3"
end
像上面那样更改你的 gemfile,然后运行 bundle
,并将你的更改提交到 Gemfile
和 Gemfile.lock
。然后,再次运行 git push heroku master
。
这将允许您在开发和测试环境中本地使用 sqlite,并根据需要在 heroku 上使用 postgres。
顺便说一句,rails 的主要优点之一是它可以让您轻松切换数据库。在其他框架中,这样做可能会花费您数小时。
关于ruby-on-rails - 编译/部署到 Heroku 时出现 sqlite3 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14844227/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!