-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* sqlite3 (= 1.3.5)
* sass-rails (= 3.2.5)
* coffee-rails (= 3.2.2)
* uglifier (= 1.2.3)
* jquery-rails (= 2.0.2)
* pg (= 0.12.2)
You have deleted from the Gemfile:
* coffee-rails (~> 3.2.1)
* jquery-rails
* sass-rails (~> 3.2.3)
* sqlite3
* uglifier (>= 1.0.3)
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
As, log is saying:
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
I think you have not commited Gemfile.lock file before pushing to heroku. Run bundle install and then commit both Gemfile and Gemfile.lock. After that push code to heroku.
Related
When I try to bundle the gemfile of a new project I get :
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler-audit was resolved to 0.6.0, which depends on
bundler (~> 1.2)
rails (~> 5.2) was resolved to 5.2.1, which depends on
bundler (>= 1.3.0)
Current Bundler version:
bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 1.2)', which is required by gem 'rails (~>
5.2)', in any of the sources.
As a result I run gem install bundler '~> 1.2'.
Now when I run gem list bundler, I have those 2 versions 2.0.2, 1.17.3
I know want to bundle my gemfile with version 1.17.3
However when I run bundle _1.17.3_ install, I get :
Could not find command "_1.17.3_".
What am I doing wrong here ? How can I fix that ? Is there a way to specify directly in my rails project with which version of bundler it should download & resolve dependencies ?
Try gem install bundler -v 1.17.3 and then bundle _1.17.3_ install
https://github.com/jhu-ep-coursera/fullstack-course3-module3-movies
I use this repo , I run rake db:seed Project want sqlite update and I add gem 'sqlite3', '~> 1.3.13' in Gemfile .
Project gives an error
(base) ➜ fullstack-course3-module3-movies git:(master) ✗ bundle
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`.
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.2.4) was resolved to 4.2.4, which depends on
bundler (< 2.0, >= 1.3.0)
Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (= 4.2.4)', in any of the sources.
You got Bundler 2.0.1 installed on your computer, but apparently your Gemfile requires bundler (< 2.0, >= 1.3.0).
You can install the required bundler version like this:
gem install bundler --version=1.x.y
I just bought a new MBP and I'm trying to execute a ruby app. After I followed this tutorial Install Ruby on Rails 5.0 · macOS Sierra,
I'm still having this issue:
MBP:test_app $ gem install rails
Successfully installed rails-5.0.1
Parsing documentation for rails-5.0.1
Done installing documentation for rails after 0 seconds
1 gem installed
MBP:test_app $ rails new .
Could not find gem 'rails (= 3.0.0)' in any of the gem sources listed in your Gemfile or available on this machine.
Try running `bundle install`.
Then, I tried:
$ bundle install
And I got the following error:
Fetching gem metadata from http://rubygems.org/..........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) was resolved to 3.0.0, which depends on
bundler (~> 1.0.0)
Current Bundler version:
bundler (1.13.7)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 1.0.0)', which is required by gem 'rails (=
3.0.0)', in any of the sources.
I guess I've already tried everything; installed bundler 1.0.0, reinstalled, deleted gems, removed ruby, rails, rvm, and installed everything again.
Please, any advice?
Solved!!
The problem was solved removing or commenting config.action_view.debug_rjs = true in development.rb file.
Thanks to everyone!
I try to push my Rails app to Heroku using git push heroku master -f command and I get this:
Total 0 (delta 0), reused 0 (delta 0)
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.9.7
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: * rails (= 4.2.0)
remote: * sass-rails (= 5.0.2)
remote: * uglifier (= 2.5.3)
remote: * coffee-rails (= 4.1.0)
remote: * jquery-rails (= 4.0.3)
remote: * turbolinks (= 2.3.0)
remote: * jbuilder (= 2.2.3)
remote: * sdoc (= 0.4.0)
remote: * sqlite3 (= 1.3.9)
remote: * byebug (= 3.4.0)
remote: * web-console (= 2.0.0.beta3)
remote: * spring (= 1.1.3)
remote: * pg (= 0.17.1)
remote: * rails_12factor (= 0.0.2)
remote: You have deleted from the Gemfile:
remote: * byebug
remote: * coffee-rails (~> 4.1.0)
remote: * jbuilder (~> 2.0)
remote: * jquery-rails
remote: * rails (= 4.2.1)
remote: * sass-rails (~> 5.0)
remote: * sdoc (~> 0.4.0)
remote: * spring
remote: * sqlite3
remote: * turbolinks
remote: * uglifier (>= 1.3.0)
remote: * web-console (~> 2.0)
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: * rails (= 4.2.0)
remote: * sass-rails (= 5.0.2)
remote: * uglifier (= 2.5.3)
remote: * coffee-rails (= 4.1.0)
remote: * jquery-rails (= 4.0.3)
remote: * turbolinks (= 2.3.0)
remote: * jbuilder (= 2.2.3)
remote: * sdoc (= 0.4.0)
remote: * sqlite3 (= 1.3.9)
remote: * byebug (= 3.4.0)
remote: * web-console (= 2.0.0.beta3)
remote: * spring (= 1.1.3)
remote: * pg (= 0.17.1)
remote: * rails_12factor (= 0.0.2)
remote:
remote: You have deleted from the Gemfile:
remote: * byebug
remote: * coffee-rails (~> 4.1.0)
remote: * jbuilder (~> 2.0)
remote: * jquery-rails
remote: * rails (= 4.2.1)
remote: * sass-rails (~> 5.0)
remote: * sdoc (~> 0.4.0)
remote: * spring
remote: * sqlite3
remote: * turbolinks
remote: * uglifier (>= 1.3.0)
remote: * web-console (~> 2.0)
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 theorderapp.
remote:
To https://git.heroku.com/theorderapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/theorderapp.git'
I try to bundle update and bundle install again and run git push heroku master -f but it's still not working.
I also try delete my Gemfile.lock file, run bundle update and bundle install again, git add and git commit it and run git push heroku master -f but it also not working for me.
This is my Gemfile btw:
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
gem 'font-awesome-sass'
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
And this is my .gitignore file:
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
Follow steps -
Step 1: Remove Gemfile.lock from your project by manually or from following command -
rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock
Step 2: Then bundle install
Step 3: git add .
Step 4: git commit -m "commiting Gemfile.lock"
Step 5: git push heroku master -f
First do a "git pull" to merge, and then push again.
or try to Execute this:
rake assets:precompile
git add .
git commit -m "Add precompiled assets for Heroku"
git push heroku master -f
to make sure you have install posgresSQL on your local by:
on MAC:
brew install postgresql
on Ubuntu:
sudo apt-get install libpq-dev
RHEL systems:
yum install postgresql-devel
Start the postgres on your local
pg_ctl -D /usr/local/var/postgres start && brew services star postgresql
Let’s make sure Postgres is installed and running
postgres -V
Login to Postgresql on terminal
sudo -u postgres psql postgres
(You may need to provide the password 'root' )
Create user
Postgres doesn’t actually directly manage users or groups, like most standard permission models do. Instead, it directly manages what it calls roles
CREATE ROLE testpostgres WITH LOGIN PASSWORD 'root';
Assign createDB permission to our new user
ALTER ROLE testpostgres CREATEDB;
Set password for new user
\password testpostgres
Create your DB
CREATE DATABASE yourDBName;
Used Postico (eggerapps.at/postico/) with UI to manage PostgresDB.
User user setup above to login to your DB via Postico.
After logged in, you may see the image like below
enter image description here
Config your database.yml
Change all adapter :sqlite3 to adapter :postgresql
Provide the username and password login to DB by added two fields to your database.yml file like:
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: localhost
username: testpostgres
password: root
timeout: 5000
Fell free to put your DB name with the field database, like:
production:
<<: *default
database: railsapp
Run
rake db:create
rake db:migrate
Commit and push code to Heroku again. It should be Ok.
References links :
https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx
I'm pretty sure it's that you don't specify the ruby version in your gemfile. I believe Heroku needs this. So it's using ruby 2.0 as the heroku default and then trying to load gems for 1.9.7 as the bundler default.
If this is right, specifying the ruby version number in the gemfile will fix the problem. See http://devcenter.heroku.com/articles/ruby-versions
I just updated my Gemfile and upgraded to rails 4.0.0 and ruby 2.0.0. I ran bundle install, bundle update, then pushed to Heroku. Then I migrated the db.
The app works on localhost but shows an application error on Heroku.
So I ran heroku run bundle update, which gave the following error:
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.
You have added to the Gemfile:
* source: https://github.com/NoamB/sorcery (at master)
* source: rubygems repository https://rubygems.org/
* rails (= 4.0.0)
* sass-rails (~> 4.0.0)
* uglifier (>= 1.3.0)
* coffee-rails (~> 4.0.0)
* jquery-rails
* turbolinks
* jbuilder (~> 1.2)
* sorcery
* thin
* pg
* rails_12factor
* sdoc
* mailcatcher
* rspec-rails
* sqlite3
* foreman
* quiet_assets
You have changed in the Gemfile:
* sorcery from `https://github.com/NoamB/sorcery (at master)` to `no specified source`
This is what my .gitignore file looks like:
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
.bundle
# Ignore the default SQLite database.
db/*.sqlite3
db/*.sqlite3-journal
db/development.sqlite3
# Ignore all logfiles and tempfiles.
log/*.log
tmp
.DS_Store
.sass-cache
.ruby-version
Procfile
.rspec
The error on Heroku is just a standard "Application error. An error occurred in the application and your page could not be served."
Here are my Heroku logs