I'm trying to push my git on heroku. For this i use :
$ git push heroku master
return :
remote: --without-sqlite3-lib=${sqlite3-dir}/
remote:
remote:
remote: Gem files will remain installed in /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.
remote: Results logged to /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to glacial-taiga-8832.
remote:
To https://git.heroku.com/glacial-taiga-8832.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/glacial-taiga-8832.git'
If i do :
$ sudo gem install sqlite3 -v '1.3.11'
it works but same problem.
Anyone can help?
You need to move the sqlite3 gem into the development section of your Gemfile. Heroku doesn't have the SQLite database installed.
Example:
group :development, :test do
gem 'sqlite3'
end
To use the database on Heroku you need to use PostgreSQL database (by default). To make it work you need to add the pg gem into the production group:
group :production do
gem 'pg'
end
Also, there are some chances that you will need to update your database.yml, but I believe Heroku will just inject their database connection setting in your config file.
Related
I try to push my project on heroku and error message pop outs
git push heroku master
remote: -----> Building on the Heroku-18 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.2.11
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.3
remote: -----> Installing dependencies using bundler 2.2.11
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Fetching gem metadata from https://rubygems.org/............
remote: **Your bundle is locked to mimemagic (0.3.5), but that version could not be found**
remote: in any of the sources listed in your Gemfile. If you haven't changed sources,
remote: that means the author of mimemagic (0.3.5) has removed it. You'll need to update
remote: your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
remote: in order to install.
remote: Bundler Output: Fetching gem metadata from https://rubygems.org/............
remote: Your bundle is locked to mimemagic (0.3.5), but that version could not be found
remote: in any of the sources listed in your Gemfile. If you haven't changed sources,
remote: that means the author of mimemagic (0.3.5) has removed it. You'll need to update
remote: your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
remote: in order to install.
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
I guess the problem is caused by rails gem mimemagic's version is out of date so I try to update to the latest version, it still doesn't work.
Here's my ruby, Rails, mimemagic version
ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
rails -v
Rails 6.1.3.1
bundle info mimemagic
* mimemagic (0.4.3)
information in Gemfile
gem 'rails', '~> 6.1', '>= 6.1.0'
gem 'bundler', '~> 2.2', '>= 2.2.1.1'
gem 'mimemagic', '~> 0.4.3'
in Gemfile.lock
mimemagic (~> 0.4.3)
run bundle update mimemagic worked for me
Change version of mimemagic to 0.3.10 in your Gemfile
Mimemagic seems to be experiencing updates? hopefully will be fixed soon. Try changing mimemagic to previous version for now..
Gemfile:
gem 'mimemagic', '~> 0.3.10'
Running bundle update will automatically update every dependency on your app to the latest version
I'm having trouble to deploy a rails app to Heroku.
When I tried to push my project to Heroku (git push heroku master), it gave me this error :
Counting objects: 300, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (269/269), done.
Writing objects: 100% (300/300), 255.34 KiB | 6.08 MiB/s, done.
Total 300 (delta 73), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.5.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.5.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.3.5
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to agora-challenge.
remote:
To https://git.heroku.com/agora-challenge.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agora-challenge.git'
However I changed my ruby version to fit with heroku 18.
I searched here https://devcenter.heroku.com/articles/ruby-support#supported-runtimes for a ruby version that is currently compatible
I installed rvm install "ruby-2.5.3"
I added the line ruby '2.5.3' to the App's Gemfile
I did run bundle install (No Error Messages)
And finally, I did run git push heroku master
Here my Gemfile
source 'https://rubygems.org'
ruby '2.5.3'
gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'rails', '5.1.6'
gem 'redis'
gem 'autoprefixer-rails'
gem 'bootstrap-sass', '~> 3.3'
gem 'font-awesome-sass', '~> 5.0.9'
gem 'sass-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'devise'
group :development do
gem 'web-console', '>= 3.3.0'
end
group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'dotenv-rails'
end
I saw this similar question: Having Trouble to deploy a Rails App to Heroku but the answer advised to go to the same link as above...
Thanks!
I am posting solution might be late but can help other.
Solution most people posting asking to upgrade ruby version. Updating ruby version in an application might be time consuming some time.
But with below solution application can deploy without updating ruby version.
Current stack heroku uses is heroku-18, Having image of Ubuntu 18.04. It have minimum supported runtime is ruby 2.4.5, other information here.
To run aplication with below this ruby version you need to downgrade heroku stack for your application.
Open console and run heroku stack you will find.
cedar-14
container
heroku-16
* heroku-18
You need to downgrade to stack which support your ruby version. For ruby 2.3.x you can set heroku-16
heroku stack:set heroku-16
Now if you run heroku stack you will find heroku-16 stack set for your application.
cedar-14
container
* heroku-16
heroku-18
You might get security vulnerability issue on console, Information here.
Try update only sprockets gem to minimum 3.7.2 like:
bundle update sprockets --bundler '3.7.2'
Or you can set :
config.assets.compile = false # Disables security vulnerability
Run git push heroku master. Boom!! Your application deployed successfully.
You should have a .ruby-version file with 2.5.3 in it
Please check Ubuntu packages that are installed in each stacks(cedar 14,cedar 16 and cedar 18) in here.
https://devcenter.heroku.com/articles/stack-packages#installed-ubuntu-packages
search for 'ruby' in the list and choose the appropriate cedar stack for the application.
I hope this information can help the others.
I am totally new to Git and Ruby on Rails and I'm doing the "The Odin Project", but I've got stucked.
I am trying to deploy the application I've created, using Git to push the master branch up to Heroku.
When I run the command "git push heroku master" I get this log with the follwing mistakes, what it may be?
matteo#matteo-VirtualBox:~/railsbridge/hello_app$ git push heroku master
Counting objects: 90, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (90/90), 22.03 KiB | 0 bytes/s, done.
Total 90 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.15.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
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: Fetching rake 12.1.0
remote: Installing concurrent-ruby 1.0.5
remote: Fetching minitest 5.10.3
....
remote: Installing turbolinks 5.0.1
remote: Fetching activesupport 5.1.4
remote: The latest bundler is 1.16.0.pre.3, but you are currently running 1.15.2.
remote: To update, run `gem install bundler --pre`
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote: current directory:
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/ruby-2.3.4/bin/ruby -r
remote: ./siteconf20171015-278-1swne7x.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'brew install sqlite3',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers. Check the mkmf.log file for more details. You may
remote: need configuration options.
remote: Provided configuration options:
remote: --with-opt-dir
remote: --srcdir=.
remote: --curdir
remote: --ruby=/tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-config
remote: --without-sqlite3-config
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote: To see why this extension failed to compile, please check the mkmf.log which can
remote: be found here:
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log
remote: extconf failed, exit code 1
remote: Gem files will remain installed in
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13
remote: for inspection.
remote: Results logged to
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote: In Gemfile:
remote: sqlite3
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.15.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
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: Fetching rake 12.1.0
remote: Fetching concurrent-ruby 1.0.5
1.4
remote: Fetching rb-inotify 0.9.10
remote: Installing rb-inotify 0.9.10
remote: The latest bundler is 1.16.0.pre.3, but you are currently running 1.15.2.
remote: To update, run `gem install bundler --pre`
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:
remote: current directory:
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/ruby-2.3.4/bin/ruby -r
remote: ./siteconf20171015-278-1swne7x.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'brew install sqlite3',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers. Check the mkmf.log file for more details. You may
remote: need configuration options.
remote:
remote: Provided configuration options:
remote: --with-opt-dir
remote: --without-opt-dir
remote: --ruby=/tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-config
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote:
remote: To see why this extension failed to compile, please check the mkmf.log which can
remote: be found here:
remote:
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log
remote:
remote: extconf failed, exit code 1
remote:
remote: Gem files will remain installed in
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13
remote: for inspection.
remote: Results logged to
remote: /tmp/build_c400101f4282a4c7d4222ce20d2d35b2/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
remote:
remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote:
remote: In Gemfile:
remote: sqlite3
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to murmuring-river-60914.
remote:
To https://git.heroku.com/murmuring-river-60914.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/murmuring-river-60914.git'
I have followed the tutorial instruction by setting the Gemfile with this inside:
group :development, :test do
gem 'sqlite3', '1.3.13'
gem 'byebug', '9.0.0', platform: :mri
end
group :production do
gem 'pg', '0.20.0'
end
For multiple buildpacks, remove all of them and then set the Ruby one:
$ heroku buildpacks:clear
$ heroku buildpacks:set heroku/ruby
About SQLite on Heroku:
SQLite runs in memory, and backs up its data store in files on disk.
While this strategy works well for development, Heroku’s Cedar stack
has an ephemeral filesystem. You can write to it, and you can read
from it, but the contents will be cleared periodically. If you were to
use SQLite on Heroku, you would lose your entire database at least
once every 24 hours.
So, for the message
sqlite3.h is missing. Try 'brew install sqlite3'`
replace the sqlite3 gem for pg in your Gemfile, then edit the database.yml file:
# Gemfile
gem 'pg'
# config/database.yml
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
database: your_project_name_dev
test:
<<: *default
database: your_project_name_test
production:
<<: *default
database: your_project_name_prod
Probably you'll need to clean the tmp/ folder, so you can delete the Gemfile.lock file and run the rails commands for that:
$ rm -rf Gemfile.lock
$ rails tmp:clear
$ rails tmp:create
I am using Rails 4.0.0.rc2 and Ruby 1.9.3 I have created application and I have push that application at GitHub repository by using git push.
When I attempt the git push heroku master command I get the following error:
C:\Sites\first_app>git push heroku master
Counting objects: 101, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (92/92), done.
Writing objects: 100% (101/101), 21.02 KiB, done.
Total 101 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: sh: 2: Syntax error: Unterminated quoted string
remote: !
remote: ! There was an error parsing your Gemfile, we cannot continue
remote: ! --- ERROR REPORT TEMPLATE ---------------------------------------------------
remote: ! - What did you do?
remote: !
remote: ! I ran the command `/tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/b
undle check`
remote: !
remote: ! - What did you expect to happen?
remote: !
remote: ! I expected Bundler to...
remote: !
remote: ! - What happened instead?
remote: !
remote: ! Instead, what actually happened was...
remote: !
remote: !
remote: ! Error details
remote: !
remote: ! LocalJumpError: no block given (yield)
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/b
undler/dsl.rb:166:in `group'
remote: ! /tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/Gemfile:11:in `eval_gemfile'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:32:in `instance_eval'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:32:in `eval_gemfile'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:10:in `evaluate'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/definition.rb:25:in `build'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler.rb:155:in `definition'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli/check.rb:11:in `run'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli.rb:103:in `check'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli.rb:10:in `start'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/bin/bundle:20:in `block in <top (required)>'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/bin/bundle:18:in `<top (required)>'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/bundle:23:in `load'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/bundle:23:in `<main>'
remote: !
remote: ! Environment
remote: !
remote: ! Bundler 1.9.7
remote: ! Rubygems 2.4.5.1
remote: ! Ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
remote: ! GEM_HOME /tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/vendor/bundle
remote: ! GEM_PATH
remote: ! Git 1.9.1
remote: !
remote: ! Bundler settings
remote: !
remote: ! frozen
remote: ! Set for the current user (/app/.bundle/config): "1"
remote: ! path
remote: ! Set for the current user (/app/.bundle/config): "vendor/bundle"
remote: ! bin
remote: ! Set for the current user (/app/.bundle/config): "vendor/bundle/bin"
remote: ! jobs
remote: ! Set for the current user (/app/.bundle/config): "4"
remote: ! without
remote: ! Set for the current user (/app/.bundle/config): "development:test"
remote: ! disable_shared_gems
remote: ! Set for the current user (/app/.bundle/config): "1"
remote: ! gemfile
remote: ! Set via BUNDLE_GEMFILE: "/tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/Gemfile"
remote: ! --- TEMPLATE END ----------------------------------------------------------------
remote: !
remote: ! Unfortunately, an unexpected error occurred, and Bundler cannot continue.
remote: !
remote: ! First, try this link to see if there are any existing issue reports for this error:
remote: ! https://github.com/bundler/bundler/search?q=no+block+given+%28yield%29&type=Issues
remote: !
remote: ! If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
remote: ! https://github.com/bundler/bundler/issues/new
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to arcane-coast-8104.
remote:
To https://git.heroku.com/arcane-coast-8104.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/arcane-coast-8104.git
and when I using heroku open command
I got this page
heroku open
what is going on?
How can I able deploy to Heroku?
Below is my whole gemfile source
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.rc2'
#Add Bootstrap for pretty UI
gem 'bootstrap-sass', '2.3.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: :production
gem 'rails_12factor', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0.rc2'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
#force for now
gem 'sprockets', '=2.11.0'
gem 'heroku', '~> 3.42', '>= 3.42.25'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
My localhost screenshot
localhost:3000
It is likely that you have a .env file in your Heroku environment, which contains a variable declaration with an unterminated string. This is evaluated by dotenv and causes problems with your Gemfile.
In my case I had added a rake task that was requiring rspec. A rescue on LoadError needed to occur bc rspec was only in development and test, not production like this:
begin
require "rspec/core/rake_task"
desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color]
t.pattern = 'spec/**/*_spec.rb'
end
rescue LoadError
end
More documentation here
Just add the following gem to your gem file:
gem 'net-ssh'
I have created a simple custom gem in 'gemz' folder and configured in gemfile ('checkpercentage', '~>0.1.0') and it works fine in my application but can't deploy it to heroku.
I'm getting the following error when trying to push my updates into my master branch at Heroku.
my Ruby version:
ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
Error:
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 ...
These are the things I tried to fix this problem but had no luck so far:
bundle install
bundle install --deployment
renamed gemfile.lock then rerun bundle install
Any help is appreciated!
When Heroku "reads" /home/nci/Zacchi/kuizu/gemz (or any other local reference) it doesn't know where to go. You need to publish your gem and remove the local reference from your Gemfile.