Ruby-on-rails-3 – git push Heroku failed because it tried to install the development gem. The bundle_without command does not work.

An error occurred after issuing the git push heroku command. This at first seemed to be bundled by using the heroku config command without the need for development: test gems. However, I’m in this similar way of writing I used this command [Heroku’s trying to install development gems even after I’ve told it not to] and it still doesn’t work.

“Use –without development: The “test” line seems to indicate that the BUNDLE_WITHOUT configuration command is valid, so this could be a gemfile or other problem?

Thank you!

$git push heroku
Counting objects: 64, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (42/42), done.
Writing objects: 100% (48/48), 6.03 KiB, done.
Total 48 (delta 15), reused 0 (delta 0)
< br />-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets. .. done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test< br /> Fetching source index for http://rubygems.org/
Installing rake (0.8.7)
Installing ZenTest (4.5.0)
Installing abstract (1.0.0)
Installing activesupport (3.0.3)
Installing builder (2.1.2)
Installing i18n (0.5.0)
Installing activemodel (3.0.3)
Installing erubis (2.6.6 )
Installing rack (1.2.2)
Installing rack-mount (0.6.14)
Installing rack-test (0.5.7)
Installing tzinfo (0.3.25) < br /> Installing actionpack (3.0.3)
Installing mime-types (1.16)
Installing polyglot (0.3.1)
Installing treetop (1.4.9)
Installing mail ( 2.2.15)
Installing actionmailer (3.0.3)
Installing arel (2.0.9)
Installing activerecord (3.0.3)
Installing activeresource (3.0.3)
Installing autotest (4.4.6)
Installing sys-uname (0.8.5) with native extensions
Installing autotest-fsevent (0.2.5) with native extensions /usr/ruby1.8.7/lib/ ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extension s': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/ruby1.8.7/bin/ruby extconf.rb
extconf.rb: 19: Only Darwin (Mac OS X) systems are supported (RuntimeError)


Gem files will remain installed in /disk1/tmp/build_258oz7hi5972n/.bundle/gems/ruby/1.8/gems /autotest-fsevent-0.2.5 for inspection.
Results logged to /disk1/tmp/build_258oz7hi5972n/.bundle/gems/ruby/1.8/gems/autotest-fsevent-0.2.5/ext/fsevent/gem_make. out
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby /1.8/rubygems/installer.rb:446:in `build_extensions'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from /usr/ruby1.8.7 /lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler /installer.rb:55:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from /usr/ruby1.8.7/lib /ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems /bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib /bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor /thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation .rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundl er/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/ base.rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
from /usr /ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
FAILED: http://devcenter.heroku.com/articles/ bundler
! Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1
To [email protected]:blooming-mountain -199.git
! [Remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to'[email protected]:blooming-mountain-199.git '

Gemfile …

source'http://rubygems.org'

gem'rails', '3.0 .3'

gem'sqlite3', '1.3.3', :require =>'sqlite3'

gem'gravatar_image_tag', '1.0.0.pre2'< br />gem'will_paginate', '3.0.pre2'

gem " nokogiri"
gem "geokit"
gem "rack", "~>1.1"

group :development, :test do
gem'rspec-rails', '2.5.0'
gem'annotate-models', '1.0.4'
gem'faker', '0.3.1'
gem'autotest-fsevent' if RUBY_PLATFORM =~ / darwin/
gem'rspec', '2.5.0'
gem'webrat', '0.7.1'
gem'spork', '0.9.0.rc4'
gem'factory_girl_rails', '1.0'

gem'ZenTest'
gem'autotest'
gem'autotest-rails'
gem'autotest-growl'
end

Well, the problem is obviously when you push to Heroku, automatic testing – fsevent Is loaded, and Heroku is not based on Darwin. Although you do have a condition to follow the gem’autotest-fsevent’ statement, when you deploy to Heroku, the gem is still trying to load. There are two possible reasons for this.

First of all, it is another gem that needs it. If nothing else, the automatic test rant should be only Darwin. I am not sure if these are relevant, but I will still double check.

The next question is to make sure that Gemfile.lock is not pushed. If you ran bundle install on Darwin last time, the gem might be locked into the dependencies. Before you commit and push to Heroku, git rm Gemfile.lock.

Finally, my favorite solution is not to use automated testing. I’m not sure if this works for you, but when I use RSpec and Cucumber, I find it annoying. I realize this last suggestion is No answer, but I don’t like to include platform-dependent gems in the test, just because when you do staging, like this There is a sudden trend of such small annoyances.

I am not sure why the Rails tutorials are still using ZenTest and automated testing. I don’t know who did it… It might change, a friend went The Rails Tutorial session of RailsConf and said that Michael is actually paying attention to the errata tutorial, maybe it will be different in future versions.

Finally please note, out of curiosity, if you are using OS X, how did you install Ruby? This is a very weird place.

I got an error after issuing the git push heroku command. This initially seemed to be bundled by using the heroku config command without development: Test gems. However, I used this command in this similar way of writing [Heroku’s trying to install development gems even after I’ve told it not to] and it still doesn’t work.

The “use –without development: test” line in the following push message seems to indicate that the BUNDLE_WITHOUT configuration command is valid, so this could be a gemfile or other problem?

Thank you!

$git push heroku
Counting objects: 64, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (42/42), done.
Writing objects: 100% (48/48), 6.03 KiB, done.
Total 48 (delta 15), reused 0 (delta 0)
< br />-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets. .. done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test< br /> Fetching source index for http://rubygems.org/
Installing rake (0.8.7)
Installing ZenTest (4.5.0)
Installing abstract (1.0.0)
Installing activesupport (3.0.3)
Installing builder (2.1.2)
Installing i18n (0.5.0)
Installing activemodel (3.0.3)
Installing erubis (2.6.6 )
Installing rack (1.2.2)
Installing rack-mount (0.6.14)
Installing rack-test (0.5.7)
Installing tzinfo (0.3.25) < br /> Installing actionpack (3.0.3)
Installing mime-types (1.16)
Installing polyglot (0.3.1)
Installing treetop (1.4.9)
Installing mail ( 2.2.15)
Installing actionmailer (3.0.3)
Installing arel (2.0.9)
Installing activerecord (3.0.3)
Installing activeresource (3.0.3)
Installing autotest (4.4.6)
Installing sys-uname (0.8.5) with native extensions
Installing autotest-fsevent (0.2.5) with native extensions /usr/ruby1.8.7/lib/ ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions' : ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/ruby1.8.7/bin/ruby extconf.rb
extconf.rb:19: Only Darwin (Mac OS X) systems are supported (RuntimeError)


Gem files will remain installed in /disk1/tmp/build_258oz7hi5972n/.bundle/gems/ruby/1.8/gems/autotest -fsevent-0.2.5 for inspection.
Results logged to /disk1/tmp/build_258oz7hi5972n/.bundle/gems/ruby/1.8/gems/autotest-fsevent-0.2.5/ext/fsevent/gem_make.out< br /> from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8 /rubygems/installer.rb:446:in `build_extensions'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from /usr/ruby1.8.7/lib /ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/i nstaller.rb:55:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in ` each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from / usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from /usr/ruby1.8.7/lib/ ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/ bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/ thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation. rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler /vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base .rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
from /usr/ ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1
To [email protected]:blooming-mountain- 199.git
! [Remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to'[email protected]:blooming-mountain-199.git'

Gemfile …

source'http://rubygems.org'

gem'rails', '3.0. 3'

gem'sqlite3', '1.3.3', :require =>'sqlite3'

gem'gravatar_image_tag', '1.0.0.pre2'
gem'will_paginate', '3.0.pre2'

gem "nokog iri"
gem "geokit"
gem "rack", "~>1.1"

group :development, :test do
gem'rspec-rails', '2.5.0'
gem'annotate-models', '1.0.4'
gem'faker', '0.3.1'
gem'autotest-fsevent' if RUBY_PLATFORM =~ / darwin/
gem'rspec', '2.5.0'
gem'webrat', '0.7.1'
gem'spork', '0.9.0.rc4'
gem'factory_girl_rails', '1.0'

gem'ZenTest'
gem'autotest'
gem'autotest-rails'
gem'autotest-growl'
end

Well, the problem is obviously that when you push to Heroku, the automatic test-fsevent is loaded, and Heroku is not based on Darwin. Although you There is indeed a condition that follows the gem’autotest-fsevent’ statement, but when you deploy to Heroku, the gem is still trying to load. There are two possible reasons for this.

First, the other Gem needs it. If nothing else, the automatic test rant should also be Darwin. I’m not sure if these are relevant, but I will still double check.

The next question is to make sure that Gemfile.lock is not pushed. If you ran bundle install on Darwin last time, the gem may be locked into the dependencies. Before you commit and push to Heroku, git rm Gemfile.lock.

Finally, my favorite solution The solution is not to use automated testing. I’m not sure if this is right for you, but when I use RSpec and Cucumber, I find it annoying. I realize this last suggestion is not answered, but I don’t like to include it in the test A gem that depends on the platform, just because there is a sudden trend of small annoyances like this when you do staging.

I’m not sure why Rails tutorials are still using ZenTest and automated testing, I don’t know Who did… it might change, a friend went to the Rails Tutorial session of RailsConf and said that Michael was actually paying attention to the errata tutorial, maybe it will be different in future versions.

Finally, please note that out of curiosity, if you are using OS X, how did you install Ruby? This is a very strange place.

Leave a Comment

Your email address will not be published.