i'm new to Ruby on Rails, app is running on local machine
local bundle works
however when i try to git push heroku master, this is the error i get:
remote:
remote: -----> Ruby/Rails app detected
remote: -----> Using Ruby version: ruby-1.9.3
remote: -----> Installing dependencies using
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
remote: /usr/bin/env: ruby1.9.1: No such file or directory
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Heroku push rejected, failed to compile Ruby/rails app
remote:
my gemfile:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.0.0.beta1'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
end
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
gem 'therubyracer', platforms: :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.0.1'
group :test do
gem 'capybara'
end
group :production do
gem 'pg'
end
what am i missing? thanks in advance!
I had a similar problem. The issue is that Bundler is generating stubs. Rails 4 apps do not store stubs in the app's bin/ directory. In order to fix this problem you need to use the following commands:
$ bundle config --delete bin
Then you need to update the bin directory to use the new Rails 4 executables
$ rake rails:update:bin
Then add the new bin/ directory to your version control using:
$ git add bin
Commit the changes and push your code to Heroku
the issue is with your ruby PATH. so first see what happens when you run
$ heroku run "ruby -v"
Running `ruby -v` attached to terminal... up, run.8734
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
Do you get similar output? If not, then check your path.
$ heroku config -s | grep PATH
GEM_PATH=vendor/bundle/ruby/1.9.1
PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
notice, how bin is in the path. in case its missing from yours, you can manually set PATH and add the bin by following command.
$ heroku config:set PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
Related
i try to deploy my rails app to heroku, but when git push heroku master i get error like this :
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
New app detected loading default bundler cache
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:
* pg
* carrierwave
* debugger
* rails_12factor
Bundler Output: 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:
* pg
* carrierwave
* debugger
* rails_12factor
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
why i get error like this? i already to try bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment and run git push heroku master again but i still get same error like before???
i'm using ruby 2.0 and rails 4, please tell me if i'm wrong? thanks before
Edit:
my gemfile:
source 'rubygems.org';
gem 'rails', '4.0.1'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'devise'
gem "twitter-bootstrap-rails"
gem 'carrierwave'
gem 'debugger',
group: [:development, :test] gem 'rails_12factor'
You can simply delete Gemfile.lock file then commit and push to heroku again.
Before this question gets closed as duplicate let me first say that I have tried multiple solutions presented in questions of similar nature. I am working through the Ruby on Rails 4.0 Tutorial and I have gotten as far as pushing my code to Heroku. However, whenever I run the following:
$ git push heroku master
I get the following:
Counting objects: 74, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (63/63), done.
Writing objects: 100% (74/74), 15.59 KiB, done.
Total 74 (delta 11), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
/usr/bin/env: ruby1.9.1: No such file or directory
Bundler Output: /usr/bin/env: ruby1.9.1: No such file or directory
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
To git#heroku.com:example.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:example.git'
I have tried several things including changing my Gemfile (see below)
Gemfile :
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
group :development do
gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'
# 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', '2.2.1'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
end
gem 'rails_12factor', group: :production
and editing the configuration variables
$ heroku config:set GEM_PATH = vendor/bundle/ruby/1.9.1
$ heroku config:set PATH = bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
I have also tried running bundle from Heroku using
$ heroku run "bundle update"
However I get this error
bash: bundle: command not found
I have also checked my logs but those are only good for post deployment problems.
Does anyone know how to fix this problem?
Perhaps there is a missing file or directory on the Heroku side of things.
It appears that in order to solve this problem you need to turn off Bundler's stub generator, because Rails 4 apps do not store stubs in the app's bin/ directory. In order to do this use the following commands:
$ bundle config --delete bin
Then you need to update the bin directory to use the new Rails 4 executables
$ rake rails:update:bin
Then add the new bin/ directory to your version control using:
$ git add bin
Commit the changes and push your code to Heroku
I am working through chapter 1 of Hartl's Rails 4.0 tutorial, and I'm stuck on Section 1.4.2, which is to push a black app into GitHub and Heroku.
I tried typing git push heroku master, but I get an error message, similar to a previous question on StackOverFlow:
Heroku push rejected - Hartl's Rails 3.2 tutorial
Heroku push rejected, railties dependency conflict? Ruby on Rails Tutorial Section 1.4.2
It's probably the same but I don't even realize it:
-----> Ruby/Rails app detected
-----> Installing dependencies using
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
/usr/bin/env: ruby1.9.1: No such file or directory
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/Rails app
Here is the Gemfile I used:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.0.0.rc1'
group :development do
gem 'sqlite3', '1.3.7'
end
gem 'sass-rails', '4.0.0.rc1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
end
UPDATE: The main error seems to be /usr/bin/env: ruby1.9.1: No such file or directory Is that folder on the Heroku machine or my home computer ?
I tried removing the line ruby '1.9.3' from my .gitignore but it still returns this message.
First, Remove ruby 1.9.3 from the Gemfile. You don't need it and may be the cause of your problem. Start of your Gemfile should look like this:
source 'https://rubygems.org'
gem 'rails', '4.0.0.rc1'
group :development do
gem 'sqlite3', '1.3.7'
end
etc........
Also, make sure you run
bundle install --without production
since you are using sqlite3 in :development and postgresql in :production
I had a similar problem. The issue is that Bundler is generating stubs. Rails 4 apps do not store stubs in the app's bin/ directory. In order to fix this problem you need to use the following commands:
$ bundle config --delete bin
Then you need to update the bin directory to use the new Rails 4 executables
$ rake rails:update:bin
Then add the new bin/ directory to your version control using:
$ git add bin
Commit the changes and push your code to Heroku
i had the same problem and the problem was that i didn't chose the version of ruby that i want to use, so i did the following:
$rvm list
ruby-1.9.3-p392 [ i686 ]
ruby-2.0.0-p247 [ i686 ]
$rvm use ruby-1.9.3-p392
$rvm list
=> ruby-1.9.3-p392 [ i686 ]
ruby-2.0.0-p247 [ i686 ]
I can't figure out what is going on here. I deployed to Heroku on Tuesday with no problem. I have not changed my Ruby version locally or on the Gemfile but heroku is telling me that I have changed Ruby Versions & it's unable to find net-scp-1.0.6. Everything works perfectly locally, I have search around and can't find anything addressing a similar problem.
Counting objects: 81, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (62/62), done.
Writing objects: 100% (62/62), 10.77 KiB, done.
Total 62 (delta 49), reused 0 (delta 0)
-----> Deleting 8 files matching .slugignore patterns.
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Ruby version change detected. Clearing bundler cache.
Old: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
New: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
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/..
Could not find net-scp-1.0.6 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
This is what my Gemfile looks like.
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.11'
gem 'aws-sdk'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'pg'
gem 'thin'
gem 'best_in_place'
gem 'stripe'
gem 'paperclip'
gem 'coffeebeans'
gem 'mail'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'carmen'
gem 'haml'
gem 'devise'
gem 'sinatra', '~> 1.3.2'
gem 'dynamic_form'
gem 'fog', '~> 1.3.1'
gem 'wicked'
gem 'lazy_high_charts', '~> 1.1.5'
gem 'jquery-datatables-rails'
gem 'sass-rails'
group :assets do
gem 'uglifier', '>= 1.0.3'
gem 'coffee-rails', '~> 3.2.1'
end
group :test, :development do
gem 'hirb'
end
Any ideas would be appreciated. Thanks.
The net-scp-1.0.6 gem was yanked recently.
Locally, run:
gem cleanup
bundle update
Then commit and push, it will update net-scp to the latest version and you'll be fine.
Looks like I figured this out. This issue was caused by net-scp being yanked from Ruby Gems due to security concerns. I followed the instructions on this Fog issue (https://github.com/fog/fog/issues/1561) and locked net-scp down to 1.0.4 and life is back in order.
I'm trying to push an Enki gem blog to Heroku and I'm getting an error
Could not find jquery-rails-2.0.0 in any of the sources
However, in the Gemfile I had
`gem 'jquery-rails'`
and I've never had a problem pushing an Enki blog with this setup before. Here's the full error message
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
After I got the error message I added this to the gemfile
gem 'jquery-rails-2.0.0'
I got this error message
Could not find gem 'jquery-rails-2.0.0 (>= 0) java' in the gems available on this machine.
I then tried to do
gem install jquery-rails
It gave me
Successfully installed jquery-rails-2.0.2
1 gem installed
Installing ri documentation for jquery-rails-2.0.2...
Installing RDoc documentation for jquery-rails-2.0.2...
But the push didn't work, same error
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.rc
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
this is the gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.6'
gem 'heroku'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# 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'
gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
group :production do
gem 'thin'
end
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'trinidad'
gem 'jruby-openssl'
end
gem 'jquery-rails'
#gem 'jquery-rails-2.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
gem 'RedCloth', '~> 4.2.9', :require => 'redcloth'
gem 'ruby-openid', :require => 'openid'
gem 'rack-openid', :require => 'rack/openid'
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
gem 'coderay'
gem 'lesstile'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.2'
gem 'exception_notification', '~> 2.5.2'
gem 'open_id_authentication'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :test do
gem 'database_cleaner'
gem 'cucumber-rails', :require => false
gem 'cucumber-websteps', :require => false
gem 'factory_girl'
gem 'rspec'
gem 'nokogiri', '~> 1.5.0'
gem 'webrat'
end
group :development, :test do
gem 'rspec-rails'
end
I was getting this same error and fixed it using:
bundle update jquery-rails
In looking into it, it appears that jquery-rails 2.0.0 was yanked from rubygems: http://d.pr/i/cLms/1ReBI4U8 for whatever reason. So you (and I) likely happened to install jquery-rails when that gem was the most current version.
It's also wise to note that deleting your Gemfile.lock can be dangerous and not recommended in most cases. This causes all the latest versions of every gem without a version number in your Gemfile to be downloaded. If gems have been updated with API-breaking changes (happens more often than you might think), your app could break. But it also might not. Just be careful, run test cases if you have them. This has caused me more than one headache.
You can read a bit more about how bundler, Gemfile, and Gemfile.lock work (as well as guidance on how to properly upgrade certain gems) here: http://viget.com/extend/bundler-best-practices
Worked for me:
delete the Gemfile.lock
removed the rails version from the line => gem 'rails' (jquery was already without a v number)
run the command "bundle install"
run also "bundle update jquery-rails" to make sure everything is updated
IMPORTANT, commit the new .lock file => run the "git add ." and "git commit ..."
push everything
Update:
I am going through mhartl's Rails Tutorials and had to update jquery-rails, '2.0.1' in the Gemfile, to get the bundle update jquery-rails going.
Thanks,
Jatin
i had similar issue by changing in Gemfile jquery-rails-2.0.0 to 2.0.1 will solved my problem.
Michael,
I had to remove the version number from my jquery gem from 2.0.0 and let it pull the latest for this to work. I am on rails 3.2.8.rc2 and running on the cedar stack of heroku. Best of luck!
Mark