- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 heroku 中安装一个 ruby 脚本。我运行 bundle install
、rake db:create
、rake db:migrate
当我试图将它部署到 heroku 时它抛出一个错误,
这是错误:
Counting objects: 858, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (366/366), done.
Writing objects: 100% (858/858), 1.27 MiB | 158.00 KiB/s, done.
Total 858 (delta 434), reused 858 (delta 434)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: ###### WARNING:
remote: Removing `Gemfile.lock` because it was generated on Windows.
remote: Bundler will do a full resolve so native gems are handled properly.
remote: This may result in unexpected gem versions being used in your app.
remote: In rare occasions Bundler may not be able to resolve your dependencies at all.
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
remote: Fetching gem metadata from https://rubygems.org/..........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Resolving dependencies...
remote: Fetching rake 12.3.0
remote: Fetching concurrent-ruby 1.0.5
remote: Fetching minitest 5.11.3
remote: Installing rake 12.3.0
remote: Installing minitest 5.11.3
remote: Installing concurrent-ruby 1.0.5
remote: Fetching thread_safe 0.3.6
remote: Fetching builder 3.2.3
remote: Installing thread_safe 0.3.6
remote: Installing builder 3.2.3
remote: Fetching erubis 2.7.0
remote: Fetching mini_portile2 2.3.0
remote: Fetching crass 1.0.3
remote: Installing erubis 2.7.0
remote: Installing mini_portile2 2.3.0
remote: Installing crass 1.0.3
remote: Fetching rack 2.0.4
remote: Fetching nio4r 2.2.0
remote: Installing rack 2.0.4
remote: Installing nio4r 2.2.0 with native extensions
remote: Fetching websocket-extensions 0.1.3
remote: Fetching mini_mime 1.0.0
remote: Installing websocket-extensions 0.1.3
remote: Fetching coffee-script-source 1.12.2
remote: Installing mini_mime 1.0.0
remote: Installing coffee-script-source 1.12.2
remote: Fetching execjs 2.7.0
remote: Installing execjs 2.7.0
remote: Fetching method_source 0.9.0
remote: Fetching thor 0.20.0
remote: Installing thor 0.20.0
remote: Installing method_source 0.9.0
remote: Fetching formtastic_i18n 0.6.0
remote: Installing formtastic_i18n 0.6.0
remote: Fetching kaminari-core 1.1.1
remote: Fetching arel 7.1.4
remote: Installing kaminari-core 1.1.1
remote: Installing arel 7.1.4
remote: Fetching rb-fsevent 0.10.2
remote: Fetching ffi 1.9.21
remote: Installing rb-fsevent 0.10.2
remote: Fetching bcrypt 3.1.11
remote: Installing bcrypt 3.1.11 with native extensions
remote: Installing ffi 1.9.21 with native extensions
remote: Using bundler 1.15.2
remote: Fetching orm_adapter 0.5.0
remote: Installing orm_adapter 0.5.0
remote: Fetching multi_json 1.13.1
remote: Installing multi_json 1.13.1
remote: Fetching nested_scaffold 1.0.0
remote: Installing nested_scaffold 1.0.0
remote: Fetching pg 1.0.0
remote: Installing pg 1.0.0 with native extensions
remote: Fetching puma 3.11.2
remote: Installing puma 3.11.2 with native extensions
remote: Fetching tilt 2.0.8
remote: Installing tilt 2.0.8
remote: Fetching turbolinks-source 5.1.0
remote: Installing turbolinks-source 5.1.0
remote: Fetching will_paginate 3.1.6
remote: Installing will_paginate 3.1.6
remote: Fetching i18n 0.9.5
remote: Installing i18n 0.9.5
remote: Fetching tzinfo 1.2.5
remote: Installing tzinfo 1.2.5
remote: Fetching nokogiri 1.8.2
remote: Installing nokogiri 1.8.2 with native extensions
remote: Fetching rack-test 0.6.3
remote: Installing rack-test 0.6.3
remote: Fetching sprockets 3.7.1
remote: Installing sprockets 3.7.1
remote: Fetching warden 1.2.7
remote: Installing warden 1.2.7
remote: Fetching websocket-driver 0.6.5
remote: Installing websocket-driver 0.6.5 with native extensions
remote: Fetching mail 2.7.0
remote: Installing mail 2.7.0
remote: Fetching coffee-script 2.4.1
remote: Installing coffee-script 2.4.1
remote: Fetching autoprefixer-rails 8.0.0
remote: Installing autoprefixer-rails 8.0.0
remote: Fetching uglifier 4.1.6
remote: Installing uglifier 4.1.6
remote: Fetching rb-inotify 0.9.10
remote: Installing rb-inotify 0.9.10
remote: Fetching turbolinks 5.1.0
remote: Installing turbolinks 5.1.0
remote: Fetching activesupport 5.0.6
remote: Installing activesupport 5.0.6
remote: Fetching sass-listen 4.0.0
remote: Installing sass-listen 4.0.0
remote: Fetching globalid 0.4.1
remote: Installing globalid 0.4.1
remote: Fetching arbre 1.1.1
remote: Installing arbre 1.1.1
remote: Fetching activemodel 5.0.6
remote: Installing activemodel 5.0.6
remote: Fetching jbuilder 2.7.0
remote: Installing jbuilder 2.7.0
remote: Fetching sass 3.5.5
remote: Installing sass 3.5.5
remote: Fetching activejob 5.0.6
remote: Installing activejob 5.0.6
remote: Fetching activerecord 5.0.6
remote: Installing activerecord 5.0.6
remote: Fetching bootstrap-sass 3.3.7
remote: Installing bootstrap-sass 3.3.7
remote: Fetching kaminari-activerecord 1.1.1
remote: Installing kaminari-activerecord 1.1.1
remote: Fetching polyamorous 1.3.3
remote: Installing polyamorous 1.3.3
remote: Fetching rails-dom-testing 2.0.3
remote: Fetching loofah 2.2.0
remote: Installing rails-dom-testing 2.0.3
remote: Installing loofah 2.2.0
remote: Fetching rails-html-sanitizer 1.0.3
remote: Installing rails-html-sanitizer 1.0.3
remote: Fetching actionview 5.0.6
remote: Installing actionview 5.0.6
remote: Fetching kaminari-actionview 1.1.1
remote: Fetching actionpack 5.0.6
remote: Installing kaminari-actionview 1.1.1
remote: Fetching kaminari 1.1.1
remote: Installing actionpack 5.0.6
remote: Installing kaminari 1.1.1
remote: Fetching actioncable 5.0.6
remote: Fetching actionmailer 5.0.6
remote: Fetching railties 5.0.6
remote: Installing actionmailer 5.0.6
remote: Installing actioncable 5.0.6
remote: Fetching formtastic 3.1.5
remote: Installing railties 5.0.6
remote: Fetching has_scope 0.7.1
remote: Installing formtastic 3.1.5
remote: Installing has_scope 0.7.1
remote: Fetching ransack 1.8.7
remote: Installing ransack 1.8.7
remote: Fetching sprockets-rails 3.2.1
remote: Installing sprockets-rails 3.2.1
remote: Fetching simple_form 3.5.1
remote: Installing simple_form 3.5.1
remote: Fetching coffee-rails 4.2.2
remote: Fetching responders 2.4.0
remote: Installing coffee-rails 4.2.2
remote: Installing responders 2.4.0
remote: Fetching jquery-rails 4.3.1
remote: Fetching rails 5.0.6
remote: Installing rails 5.0.6
remote: Fetching sass-rails 5.0.7
remote: Installing sass-rails 5.0.7
remote: Fetching inherited_resources 1.8.0
remote: Fetching devise 4.4.1
remote: Installing inherited_resources 1.8.0
remote: Installing jquery-rails 4.3.1
remote: Installing devise 4.4.1
remote: Fetching activeadmin 1.2.1
remote: Installing activeadmin 1.2.1
remote: Bundle complete! 18 Gemfile dependencies, 79 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (30.42s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: DEPRECATION WARNING: `config.static_cache_control` is deprecated and will be removed in Rails 5.1.
remote: Please use
remote: `config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=2592000' }`
remote: instead.
remote: (called from block in <top (required)> at /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/config/environments/production.rb:28)
remote: intializing git
remote: rake aborted!
remote: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.6/lib/active_record/connection_adapters/connection_specification.rb:176:in `rescue in spec'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.6/lib/active_record/connection_adapters/connection_specification.rb:173:in `spec'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.6/lib/active_record/connection_handling.rb:53:in `establish_connection'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.6/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:49:in `each'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/devise-4.4.1/lib/devise/mapping.rb:78:in `modules'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/devise-4.4.1/lib/devise/mapping.rb:95:in `routes'
remote:
/tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/initializable.rb:55:in `block in run_initializers'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/initializable.rb:54:in `run_initializers'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/application.rb:352:in `initialize!'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/config/environment.rb:5:in `<top (required)>'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `block in require'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in `load_dependency'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/application.rb:328:in `require_environment!'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/application.rb:448:in `block in run_tasks_blocks'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote: /tmp/build_95d492fa8732a678c298a47e2e3bb8e4/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to limitless-hamlet-95451.
remote:
To https://git.heroku.com/limitless-hamlet-95451.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/limitless-hamlet-95451.git
'在本地主机上它运行流畅..
最佳答案
当你创建一个 Rails 5 应用程序时
rails new app-name -d postgresql
默认情况下,它会将 postgres gem (pg) 设置为 0.21。
可能您在开始项目时跳过了这一步,并在以后的阶段添加了 pg
。让我们倒带。
rails new without-db #defaults to sqlite3
cd without-db
然后我编辑了我的 Gemfile 替换
gem 'sqlite3'
到
gem 'pg'
然后
bundle install
现在,postgres gem 版本是 1.0.0。编辑我的 database.yml
以获取连接凭据。然后是生成模型、迁移、 Controller 等的一些东西,并将它们推送到 heroku。
$ rails g scaffold book title:string author:string genre:string description:string
...
$ rake db:create
...
$ rake db:migrate
...
$ heroku login
...
$ git init
...
$ heroku git:remote -a without-db-sample
...
$ git add .
...
$ git commit -m "initial commit"
...
$ git push heroku master
...
$ heroku run rake db:migrate
...
$ heroku open
虽然我不喜欢这个版本的 pg,但它工作正常。
然后再次编辑Gemfile
,替换,
gem 'pg'
到
gem 'pg', '~> 0.18'
然后
$ bundle install
...
$ bundle show pg
/home/ziya/.rvm/gems/ruby-2.4.1/gems/pg-0.21.0
$ git status
...
$ git add .
...
$ git commit -m "change postgres version"
...
$ git push heroku master
关于ruby - 将 `gem ' pg'` 添加到您的 Gemfile 并确保其版本处于 ActiveRecord 所需的最低版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48911869/
This question already has answers here: Closed 11 years ago. Duplicate: Recommended website resoluti
我有一个网络应用程序需要 IE9。其他浏览器(Firefox、Chrome、Opera 等)的等效浏览器版本是什么? 我知道如何检查用户当前的浏览器/版本,如果不支持,我需要看看是否可以为用户提供下载
我在比较 Mysql 数据库中的两个值并显示最低值时遇到问题。 比如我有这个: value1 = 23.4 value2 = 4.479 我试过这个: ORDER BY CAST(column AS
我有一个需要使用的功能,但我需要将我的最小 SDK 设置为 23 才能使用它。问题是,我们的应用程序运行在很多低端 SDK 设备上。有什么方法可以设置我的项目以允许我在编译应用程序的同时仍然使用较低的
我需要在32位数字中获得一个1位数字,其中只有一个1位(总是)。用C ++或asm最快的方法。 例如 input: 0x00000001, 0x10000000 output:
我已经对我的数据进行了分组。现在,我要做的是每周从“高”列中选择最高值,并从“低”列中选择最低值,然后使用最高值减去最低值得到范围。但是代码总是错误的。有人对我有想法吗? 这是我的 DataFrame
如何编写一个存储 20 个数字的数组,然后显示以下数据:数组中最小的数字、最大的数字、数字的总和以及它们的平均值? 最佳答案 使用java编程语言 int myArray[] = {15,25,85,
在学习 C 的同时做一些实验,我遇到了一些奇怪的事情。这是我的程序: int main(void) {sleep(5);} 当它被编译时,可执行文件的文件大小为 8496 字节(与 26 字节的源代码
我已经创建了我想在我的项目中使用的包。在包中,我使用的是 UIStackView。当我将包添加到项目并运行它时,我收到错误 'UIStackView' 仅适用于 iOS 9.0 或更高版本。如果我的项
我已经制定了一个程序来显示给定日期的特定时间的最高和最低流行项目。该过程没有错误或异常,并且一切正常。如您所见,为了显示 Items 的第一条记录,查询重复了两次,但唯一的区别在于顺序(ASC 和 D
我是 BPEL/BPMN 新手。 是否可以在没有 WS-* Web 服务和 EJB 容器(例如 jBoss、WebLogic、Glassfish)的情况下编写 BPEL/BPMN 感知软件? 我想知道
我们正在使用 OpenGL 4.3。但是,我们担心我们使用的功能适用于我们的显卡,但不符合 OpenGL 4.3 的“最低”要求规范。 是否有可能模拟最低限度的行为?例如,让显卡拒绝任何非标准纹理格式
我正在我的应用程序中实现 Facebook SDK。 按照 facebook 开发人员指南,除了我没有设置 GIT,所以我下载了 SDK,并将其导入 Eclipse,将 Java 合规级别更改为 1.
所以我构建了一个使用 API 15 中特定默认配色方案的应用程序。但是,我知道大多数设备仍在运行 API 10。为了吸引这些设备,我在我的设备上切换了最小 SDK设备到 10。这样做之后,我注意到我的
数据 所以,假设我有一个应用程序,我正在测试汽车的速度、性能、安全性等。我有一组以下格式的数据: CAR TABLE ID CAR_NAME 1 Ford Focus 2006 2 To
我有以下查询: SELECT AVG(q1) AS q1, AVG (q2) AS q2, AVG(q3) AS q3, AVG(q4) AS q4, AVG(q5) AS q5 FROM tresu
我刚刚创建了我的第一个 Android 应用程序(第 10 次)。我创建的项目的 sdk 比我预期的要高,现在我想降低它。我最初的 android maifest 不包含 部分,所以我补充说: 我还
我的小组作业是制作一个程序,允许用户输入任意数量的数字,然后程序会告诉你输入的最高数字、输入的最低数字、平均值、输入的总数和平均值。我们必须使用菜单。 我们已经写好了菜单。我们的大部分计算代码都在案例
我正在尝试设置一个显示文档目录中数据的 UITableView。 我对代码有点迷茫,因为我尝试了来自 Google 和论坛等的许多示例。 我正在创建没有 Storyboard 的应用程序,所以它全部在
我们都知道将最后 1 位设置为 0 的技巧 n&(n-1)。例如,0110 & (0110-1) = 0100。但是反过来呢?将最后一个 0 设置为 1?所以 0110 变成 0111? 我在 sta
我是一名优秀的程序员,十分优秀!