I have referred to several different sources in order to try to push Heroku..
the error code I'm getting is:
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
I've tried several Gemfile configurations but this is what I currently have:
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
I've also tried different bundles after.. bundle, bundle install, bundle install --without development
I keep getting the same error.
Please help
Thank you
ps: Please note, I'm new with a lot of this.. So please be as specific as possible.
Thanks again
try (on fedora) or equivalent, and then either install this gem alone or restart the bundle.
yum install sqlite-devel
Related
when I tried to start Server with command rails -s that throw an error:
Could not find gem 'therubyracer x86-mingw32' in any of the gem sources listed i
n your Gemfile.
Run bundle install to install missing gems.
I also try with
gem install
gem update ...
but no effect
my gem file:
gem 'therubyracer', group: :production
I don't know why that can not run! but run with another project is OK.
how can I resolve this?
You can run bundle install --without production to skip that gem being installed for development.
I have not idea how to fix this error. I've ran bundle install 1 million times. My gem file has the following code underneath and I am not deleting sqlite3 from my gem file:
group :development do
gem 'sqlite3'
end
group :production do
gem "pg"
end
Error from server log:
Gem files will remain installed in /tmp/build_5072a680-186f-45ae-bc1a-355f12885b46/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /tmp/build_5072a680-186f-45ae-bc1a-355f12885b46/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out
Installing rack-test 0.6.2
Installing warden 1.2.3
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!
! Push rejected, failed to compile Ruby app
Try this:
Make sure to install PG on Heroku. If you have heroku toolbelt installed. Open the CMD.
heroku addons:add heroku-postgresql
Make sure your gem file looks like this without white spaces:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Try to run bundle
bundle install --deployment
I'm having some trouble with Herouku. I can't push because of the following error:
Gem files will remain installed in /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7 for inspection.
Results logged to /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/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.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!
! Push rejected, failed to compile Ruby/Rails app
And I can't solve it.
I have tried the following:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
And I keep getting the same error. I have even tried to remove sqlite3 completely. Same annoying error. I made sure to push my changes before running git push heroku master. Any ideas? Or I will probably give up on Heroku...
I've had similar problems before. This works for me in my Gemfile:
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: [:production]
Also, in your local git checkout, execute the command heroku config. Confirm that the output has the following environment variables set:
RACK_ENV: production
RAILS_ENV: production
Give that a shot. Does it work for you?
How about this?
heroku rake db:reset
heroku rake db:migrate
I need to parse sqlite files on heroku, and as far as i know Heroku does not support sqlite.
In local, i am using the gem sqlite3, but it is rejected when pushing on heroku.
How can i use 'require sqlite3' in production ?
here is the error:
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
Failed to install gems via Bundler.
Heroku push rejected, failed to compile Ruby/rails app
Thanks in advance
Pretty sure you just don't want to do that: https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
Heroku doesn't support sqlite and you have to use PostgreSQL. Sorry dude.
This older SO thread has a work around though:
Deploying RoR app to Heroku with Sqlite3 fails
The winning answer there was just use sqlite for dev so: (copy pasting)
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
I've tried to push an app to Heroku in the same way I have always done. I'm using Ruby 1.9.2 and Rails 3.2.1. However, now I'm getting this error message. I did what it recommends
make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
Note, it's doing this even though I did in my gemfile
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
but doing gem install sqlite3 -v '1.3.5' in the terminal, but the push is still being rejected. I'm not sure how to check the Gem files it refers to in the tmp directory but even if I did, i wouldn't understand them
Any suggestions?
Gem files will remain installed in /tmp/build_1timyd7o5k59l/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5 for inspection.
Results logged to /tmp/build_1timyd7o5k59l/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
I always just comment out the SQLite3 gem and it works well for me, so when I push to heroku my gemfile looks like this:
# Development Database
#gem 'sqlite3'
# Production Database
gem 'pg'
EDIT:
The above solution works, and is easy if you don't want to update your gems for whatever reason. The better long term solution to this problem is to do the following:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
then delete your gemfile.lock file.
You'll need to generate a new gemfile.lock file that reflects your changes. In the terminal run:
bundle update
Finally, update your repository and push to heroku by doing the following in the terminal:
git add .
git commit -m "commit message"
git push heroku
Actually your initial Gemfile code was correct if you wanted to use sqlite3 locally. like you showed, you put this in the gem file:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
then you have to delete your local Gemfile.lock, and run:
bundle update
to re-build the .lock file. then add and re-commit the Gemfile:
git add Gemfile
git commit -m "Gemfile commit message"
then push the new Gemfile to the repo:
git push master
change the GIT details accordingly of course, but you get the point. it's all about adding/committing/pushing the Gemfile.
As far as I know Heroku does not support sqlite3, but instead you with a PostgreSQL database. You'll need to modify your Gemfile as such, and your database.yml. So for your production group, in your Gemfile, you'll want:
https://devcenter.heroku.com/articles/rails3
edit:
There appears to be a more detailed answer here, so this may be a duplicate: Pushing Rails with SQLite3 to Heroku fails
you must add updated Gemfile.lock to git and try git push heroku master...
it worked for me and for sure it will for you too
and donot forget to add
config.action_controller.perform_caching = true