Rails Server Error: Undefined Method 'active_record' - ruby-on-rails

I'm a Rails 4 beginner who's been up all night stuck trying to start up my rails server. I'm working through Hartls' Ruby on Rails tutorial 3rd edition for Rails 4. I've been able to complete a \ "hello world" style app and run it on my local server. Heck, I even set up the toy_app in chapter 2 that allowed some user input and microblogging.
Suddenly, things have changed, and I'm stuck. I can't run rails server on any new apps I create. Here's what I mean:
First, I run the same commands to set up an app in my workspace:
cd
cd workspace
rails _4.2.2_ new sample_app
This returns the same basic Rails structure as my two previously successful apps. Now, I open the gem file, and I edit the gem file to look like the one Hartl has listed for the Chapter 3 exercise.
Here is the Gem file:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
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
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
Next, I run bundle_install, and this is what I get back from the terminal (I'm on a Mac):
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.7.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.2
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.2
Using globalid 0.3.5
Using activejob 4.2.2
Using mime-types 2.6.1
Using mail 2.6.3
Using actionmailer 4.2.2
Using activemodel 4.2.2
Using arel 6.0.1
Using activerecord 4.2.2
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.3.pre1 (was 0.7.2)
Using bundler 1.9.6
Using columnize 0.9.0
Using debugger-linecache 1.2.0
Using slop 3.6.0
Using byebug 3.4.0 (was 5.0.0)
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.2
Using coffee-rails 4.1.0
Using multi_json 1.11.2
Using jbuilder 2.2.3 (was 2.3.1)
Using jquery-rails 4.0.3 (was 4.0.4)
Using sprockets 3.2.0
Using sprockets-rails 2.3.2
Using rails 4.2.2
Using rdoc 4.2.0
Using sass 3.4.16
Using tilt 1.4.1
Using sass-rails 5.0.2 (was 5.0.3)
Using sdoc 0.4.0 (was 0.4.1)
Using spring 1.1.3 (was 1.3.6)
Using sqlite3 1.3.9 (was 1.3.10)
Using turbolinks 2.3.0 (was 2.5.3)
Using uglifier 2.5.3 (was 2.7.1)
Using web-console 2.0.0.beta3 (was 2.2.1)
Bundle complete! 12 Gemfile dependencies, 56 gems now installed.
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
I notice this time around that the terminal does not prompt me for my password, which I believe it had in the past. I'm assuming that the error is happening here with the bundler, but I'm not sure what it is. Does it have to do with skipping the production group? I know Hartl recommends skipping it later for the sake of heroku deployment, but I don't even have a production group listed in my Gemfile yet! Anyway, next I call
cd ~/workspace/sample_app
rails server
And here is what I get back:
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
/Library/Ruby/Gems/2.0.0/gems/railties- 4.2.2/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x007fd1dc4fb158> (NoMethodError)
from /Users/SSSPro02/workspace/matt_app/config/application.rb:24:in `<class:Application>'
from /Users/SSSPro02/workspace/matt_app/config/application.rb:10:in `<module:MattApp>'
from /Users/SSSPro02/workspace/matt_app/config/application.rb:9:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/SSSPro02/workspace/matt_app/bin/rails:8:in `require'
from /Users/SSSPro02/workspace/matt_app/bin/rails:8:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/SSSPro02/workspace/matt_app/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
From what I gather, it's telling me it can't find 'active_record', which has not been a problem until now. I've even tried to recreate the basic hello_world app in chapter 1 with a different gem file, and I am still getting this error whenever I try to start up the server. Any help would be greatly appreciated. Let me know if there is any additional information I should include.

Try bundle update.
Try delete Gemfile.lock then bundle install again.
Verify your config/application.rb is this line present?
require "active_record/railtie"
if not add it, if yes and commented then uncomment it.

Have you tried running bundle from inside your Rails app manually? So:
cd sample_app
bundle

Related

rails server and console not loading

Using rbenv and Rails 4.2.6, when I run bundle exec rails s or bundle exec rails c, I see the following:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
That's all, nothing else happens. If I then stop spring, and run bundle exec rails c, the following appears:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
dyld: lazy symbol binding failed: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
Any idea what's wrong here? Thanks!
Update: add content of gemfile and ouput of bundle install
Gemfile:
source 'https://rubygems.org'
ruby "2.3.1"
gem 'rails', '4.2.6'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'simple_form'
gem "puma"
gem 'dotenv-rails', :groups => [:development, :test]
gem 'quiet_assets', :group => :development
gem "rails_12factor"
gem 'slack-ruby-client'
gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x'
gem 'bootstrap-sass', '~> 3.3.6'
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.4'
gem 'factory_girl_rails', '~> 4.0'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'guard'
gem 'guard-rspec', require: false
gem 'terminal-notifier-guard'
gem 'spring'
end
Output of bundle install:
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using execjs 2.7.0
Using debug_inspector 0.0.2
Using sass 3.4.22
Using byebug 9.0.5
Using coderay 1.1.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using diff-lcs 1.2.5
Using dotenv 2.1.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using formatador 0.2.5
Using gli 2.14.0
Using rb-fsevent 0.9.7
Using ruby_dep 1.3.1
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using rspec-support 3.4.1
Using hashie 3.4.4
Using multi_json 1.12.1
Using pg 0.18.4
Using puma 3.4.0
Using bundler 1.12.5
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using tilt 2.0.5
Using websocket-extensions 0.1.2
Using spring 1.7.1
Using terminal-notifier-guard 1.7.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using autoprefixer-rails 6.3.6.2
Using uglifier 3.0.0
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using sprockets 3.6.1
Using faraday 0.9.2
Using rb-inotify 0.9.7
Using notiffany 0.1.0
Using pry 0.10.3
Using rspec-core 3.4.4
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using rails_12factor 0.0.3
Using websocket-driver 0.6.4
Using sdoc 0.4.1
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using bootstrap-sass 3.3.6
Using faraday_middleware 0.10.0
Using listen 3.1.5
Using rspec 3.4.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using factory_girl 4.7.0
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using slack-ruby-client 0.7.4
Using guard 2.14.0
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using guard-rspec 4.7.2
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using simple_form 3.2.1
Using coffee-rails 4.1.1
Using dotenv-rails 2.1.1
Using factory_girl_rails 4.7.0
Using jquery-rails 4.1.1
Using quiet_assets 1.1.0
Using rails-i18n 4.0.8 from git://github.com/svenfuchs/rails-i18n.git (at rails-4-x#129b9fb)
Using rspec-rails 3.4.2
Using rails 4.2.6
Using sass-rails 5.0.4
Using web-console 2.3.0
Using turbolinks 2.5.3
Bundle complete! 25 Gemfile dependencies, 102 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Update 2 - added bundle exec gem pristine --all
bundle exec gem pristine --all
Restoring gems to pristine condition...
Restored rake-11.2.2
Restored i18n-0.7.0
Skipped json-1.8.3, it is a default gem
Restored minitest-5.9.0
Restored thread_safe-0.3.5
Restored tzinfo-1.2.2
Restored activesupport-4.2.6
Restored builder-3.2.2
Restored erubis-2.7.0
Restored mini_portile2-2.1.0
Restored pkg-config-1.1.7
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
current directory: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8/ext/nokogiri
/Users/nandersen/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160620-6035-1m3373p.rb extconf.rb
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
/Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find nokogiri-1.6.8 in any of the sources (Bundler::GemNotFound)
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
extconf failed, exit code 1
Gem files will remain installed in /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8 for inspection.
Results logged to /Users/nandersen/Projects/the-lunch/vendor/bundle/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/gem_make.out
The problem is debug_inspector gem, you could try to remove web-console gem in your Gemfile, bundle install, and run the server again.
UPDATE:
Or if you would like to keep the web-console gem, you could try to remove all the gems you have installed, and re-bundle install them again. According to this issue on rails/web-console.

Heroku Application Error Hello_App from Ruby on Rails tutorial

I'm in the deployment section of the first chapter of the Ruby on Rails tutorial, and I can't make things work! I'm using the Cloud9 workspace.
My Gemfile is:
source 'https://rubygems.org'
ruby '2.2.1'
gem 'rails', '4.2.0'
gem 'sass-rails', '5.0.1'
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
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
My Heroku installation log is:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.2.1
-----> Installing dependencies using 1.9.7
Ruby version change detected. Clearing bundler cache.
Old: ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-linux]
New: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 10.4.2
Installing minitest 5.7.0
Installing i18n 0.7.0
Installing builder 3.2.2
Installing thread_safe 0.3.5
Installing mini_portile 0.6.2
Installing erubis 2.7.0
Installing rack 1.6.4
Installing mime-types 2.6.1
Installing coffee-script-source 1.9.1.1
Installing arel 6.0.2
Installing json 1.8.3
Installing execjs 2.5.2
Installing thor 0.19.1
Using bundler 1.9.7
Installing multi_json 1.11.2
Installing rails_stdout_logging 0.0.3
Using rdoc 4.2.0
Installing rails_serve_static_assets 0.0.4
Installing tilt 1.4.1
Installing sass 3.4.16
Installing tzinfo 1.2.2
Installing rack-test 0.6.3
Installing sprockets 3.2.0
Installing mail 2.6.3
Installing coffee-script 2.4.1
Installing uglifier 2.5.3
Installing sdoc 0.4.0
Installing rails_12factor 0.0.2
Installing activesupport 4.2.0
Installing rails-deprecated_sanitizer 1.0.3
Installing globalid 0.3.5
Installing activemodel 4.2.0
Installing jbuilder 2.2.3
Installing activejob 4.2.0
Installing activerecord 4.2.0
Installing pg 0.17.1
Installing nokogiri 1.6.6.2
Installing loofah 2.0.2
Installing rails-dom-testing 1.0.6
Installing rails-html-sanitizer 1.0.2
Installing actionview 4.2.0
Installing actionpack 4.2.0
Installing sprockets-rails 2.3.2
Installing actionmailer 4.2.0
Installing railties 4.2.0
Installing coffee-rails 4.1.0
Installing jquery-rails 4.0.3
Installing rails 4.2.0
Installing sass-rails 5.0.1
Installing turbolinks 2.3.0
Bundle complete! 14 Gemfile dependencies, 51 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
Bundle completed (35.52s)
Cleaning up the bundler cache.
Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
and using the production group of your Gemfile.
rake aborted!
NameError: uninitialized constant Sass::Script
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in `<top (required)>'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `<top (required)>'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `<top (required)>'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/config/application.rb:7:in `<top (required)>'
/tmp/build_e66783d527b235cf6db9221a52037d9b/Rakefile:4:in `require'
/tmp/build_e66783d527b235cf6db9221a52037d9b/Rakefile:4:in `<top (required)>'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/tmp/build_e66783d527b235cf6db9221a52037d9b/vendor/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
vendor/bundle/bin/rake:16:in `load'
vendor/bundle/bin/rake:16:in `<main>'
###### WARNING:
No Procfile detected, using the default web server (webrick)
https://devcenter.heroku.com/articles/ruby-default-web-server
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby -> console, rake, web, worker
-----> Compressing... done, 29.1MB
-----> Launching... done, v6
https://lit-caverns-5466.herokuapp.com/ deployed to Heroku
When I open the link I get the message:
Application Error
An error occurred in the application and your page could not be
served. Please try again in a few moments.
If you are the application owner, check your logs for details.
Does your app run successfully in production mode locally ? If not try to run your app locally in production mode and you might be able to spot the issue.
bundle install --without development:test
RAILS_ENV=production rake db:create db:migrate
RAILS_ENV=production rails s

Mina deploy failure - cannot load such file -- Nokogiri

I'm using Mina to deploy a Rail application to a VPS (digital ocean).
When I use mina deploy I keep getting the same error:
rake aborted!
LoadError: cannot load such file -- nokogiri
C:\Sites\app>mina deploy --trace
** Invoke deploy (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke rvm:use (first_time)
** Execute rvm:use
** Execute deploy
** Invoke git:clone (first_time)
** Execute git:clone
** Invoke deploy:link_shared_paths (first_time)
** Execute deploy:link_shared_paths
** Invoke bundle:install (first_time)
** Execute bundle:install
** Invoke rails:db_migrate (first_time)
** Execute rails:db_migrate
** Invoke rails:assets_precompile (first_time)
** Execute rails:assets_precompile
** Invoke deploy:cleanup (first_time)
** Execute deploy:cleanup
user#45.45.45.45's password:
-----> Using RVM environment 'ruby-2.2.1#default'
$ rvm use "ruby-2.2.1#default" --create
Using /usr/local/rvm/gems/ruby-2.2.1
-----> Creating a temporary build path
$ touch "deploy.lock"
$ mkdir -p "./tmp/build-%s2267"
$ cd "./tmp/build-%s2267"
-----> Fetching new git commits
$ (cd "/home/user/app/scm" && git fetch "git#bitbucket.org:user/app.git" "master:master" --force)
Enter passphrase for key '/home/user/.ssh/id_rsa':
-----> Using git branch 'master'
$ git clone "/home/user/app/scm" . --recursive --branch "master"
Cloning into '.'...
done.
-----> Using this git commit
$ git --no-pager log --format='%%%%aN (%%%%h):%%%%n> %%%%s' -n 1 %aN (%h):%n> %s
$ rm -rf .git
-----> Symlinking shared paths
$ mkdir -p "./config"
$ mkdir -p "."
$ rm -rf "./config/database.yml"
$ ln -s "/home/user/app/shared/config/database.yml" "./config/database.yml"
$ rm -rf "./log"
$ ln -s "/home/user/app/shared/log" "./log"de
-----> Installing gem dependencies using Bundler
$ mkdir -p "/home/user/app/shared/bundle"
$ mkdir -p "./vendor"
$ ln -s "/home/user/app/shared/bundle" "./vendor/bundle"
$ bundle install --without development:test --path "./vendor/bundle" --deployment
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.6.1
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.2
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.0
Using rack 1.6.1
Using rack-test 0.6.3
Using actionpack 4.2.0
Using globalid 0.3.5
Using activejob 4.2.0
Using mime-types 2.5
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemerchant 1.47.0
Using activemodel 4.2.0
Using arel 6.0.0
Using activerecord 4.2.0
Using acts_as_list 0.7.2
Using addressable 2.3.8
Using execjs 2.5.2
Using autoprefixer-rails 5.1.11
Using awesome_nested_set 3.0.2
Using sass 3.4.13
Using bootstrap-sass 3.3.4.1
Using camertron-eprun 1.1.0
Using cancancan 1.10.1
Using bundler 1.8.4
Using thor 0.19.1
Using railties 4.2.0
Using sprockets 3.0.3
Using sprockets-rails 2.3.0
Using rails 4.2.0
Using canonical-rails 0.0.9
Using carmen 1.0.2
Using cldr-plurals-runtime-rb 1.0.0
Using climate_control 0.0.3
Using cocaine 0.5.7
Using coffee-script-source 1.8.0
Using coffee-script 2.4.1
Using coffee-rails 4.1.0
Using colorize 0.7.7
Using css_parser 1.3.6
Using daemons 1.2.2
Using polyglot 0.3.5
Using deface 1.0.1
Using orm_adapter 0.5.0
Using responders 2.1.0
Using warden 1.2.3
Using devise 3.4.1
Using devise-encryptable 0.1.2
Using eventmachine 1.0.7
Using ffaker 1.32.1
Using font-awesome-rails 4.3.0.0
Using friendly_id 5.1.0
Using friendly_id-globalize 1.0.0.alpha1
Using globalize 5.0.1
Using highline 1.6.21
Using htmlentities 4.3.3
Using multi_xml 0.5.5
Using httparty 0.13.3
Using i18n_data 0.5.1
Using multi_json 1.11.0
Using jbuilder 2.2.13
Using jquery-rails 4.0.3
Using jquery-ui-rails 5.0.3
Using kaminari 0.16.3
Using kaminari-i18n 0.3.2
Using khipu 1.3.5
Using open4 1.3.4
Using mina 0.3.4
Using money 6.5.1
Using monetize 1.3.0
Using paperclip 4.2.1
Using paranoia 2.1.2
Using polyamorous 1.2.0
Using premailer 1.8.4
Using premailer-rails 1.8.1
Using rabl 0.9.4.pre1
Using rails-i18n 4.0.4
Using ransack 1.4.1
Using rdoc 4.2.0
Using tilt 1.4.1
Using sass-rails 5.0.3
Using sdoc 0.4.1
Using select2-rails 3.5.9.1
Using state_machines 0.2.2
Using state_machines-activemodel 0.1.2
Using state_machines-activerecord 0.2.0
Using stringex 2.5.2
Using truncate_html 0.9.2
Using twitter_cldr 3.1.2
Using spree_core 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-stable
)
Using versioncake 2.3.1
Using spree_api 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-stable)
Using spree_backend 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-sta
ble)
Using spree_cmd 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-stable)
Using spree_frontend 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-st
able)
Using spree_sample 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-stab
le)
Using spree 3.0.2.beta from git://github.com/spree/spree.git (at 3-0-stable)
Using spree_auth_devise 3.0.0 from git://github.com/spree/spree_auth_devise.git
(at 3-0-stable)
Using spree_gateway 3.0.0.beta from git://github.com/spree/spree_gateway.git (at
3-0-stable)
Using spree_i18n 3.0.0 from git://github.com/spree/spree_i18n.git (at 3-0-stable
)
Using spree_slider 1.2.0 from git://github.com/spree-contrib/spree_slider.git (a
t master)
Using spree_static_content 2.3.0 from git://github.com/spree-contrib/spree_stati
c_content.git (at 3-0-stable)
Using thin 1.6.3
Using turbolinks 2.5.3
Using uglifier 2.7.1
Bundle complete! 25 Gemfile dependencies, 116 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
-----> Migrating database
$ RAILS_ENV="production" bundle exec rake db:migrate
rake aborted!
LoadError: cannot load such file -- nokogiri
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/loofah-2.0.2/l
ib/loofah.rb:3:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/loofah-2.0.2/l
ib/loofah.rb:3:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/rails-html-san
itizer-1.0.2/lib/rails-html-sanitizer.rb:2:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/rails-html-san
itizer-1.0.2/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/sanitize_helper.rb:3:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/sanitize_helper.rb:3:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_helper.rb:4:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers.rb:50:in `<module:Helpers>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/actionview-4.2
.0/lib/action_view/helpers.rb:3:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/legacy_asset_tag_helper.rb:7:in `<module:LegacyAsset
TagHelper>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/legacy_asset_tag_helper.rb:6:in `<module:Rails>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/legacy_asset_tag_helper.rb:4:in `<module:Sprockets>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/legacy_asset_tag_helper.rb:3:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/helper.rb:54:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/helper.rb:54:in `<module:Helper>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/helper.rb:7:in `<module:Rails>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/helper.rb:6:in `<module:Sprockets>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/rails/helper.rb:5:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/railtie.rb:6:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sprockets-rail
s-2.3.0/lib/sprockets/railtie.rb:6:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass/rails/railtie.rb:3:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass/rails/railtie.rb:3:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass/rails.rb:11:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass/rails.rb:11:in `<top (required)>'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass-rails.rb:1:in `require'
/home/user/app/tmp/build-%s2267/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0
.3/lib/sass-rails.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
76:in `require'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
76:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
72:in `each'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
72:in `block in require'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
61:in `each'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler/runtime.rb:
61:in `require'
/usr/local/rvm/gems/ruby-2.2.1#global/gems/bundler-1.8.4/lib/bundler.rb:134:in `
require'
/home/user/app/tmp/build-%s2267/config/application.rb:7:in `<top (required)>
'
/home/user/app/tmp/build-%s2267/Rakefile:4:in `require'
/home/user/app/tmp/build-%s2267/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
! ERROR: Deploy failed.
-----> Cleaning up build
$ rm -rf "./tmp/build-%s2267"
Unlinking current
$ rm -f "deploy.lock"
OK
Connection to 45.45.45.45 closed.
It seems that all the necessary gems are being installed except for Nokogiri. I'm not sure how to fix this.
This is my Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'coffee-script-source', '1.8.0'
# 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'
gem 'jbuilder', '~> 2.0'
gem 'khipu'
gem 'mina'
gem 'nokogiri', '1.6.1'
# gem 'unicorn'
gem 'spree_khipu', :path => '../spree_khipu'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spree', github: 'spree/spree', branch: '3-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_i18n', :github => 'spree/spree_i18n', branch: '3-0-stable'
gem 'spree_slider', github: 'spree-contrib/spree_slider'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: '3-0-stable'
gem 'bootstrap-sass', '~> 3.3.4'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'thin'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
group :production do
gem 'pg'
end
Finally a fix this by bundle install on a linux machine so the Gemfile.lock get updated, then I try again to mina deploy and everything works fine.
Couldn't figure out what was the exact problem with my previous version of the Gemfile.lock

After Xcode 4.4 and OSX 10.8 Installation - 'Failed to build gem native extension' when installing libv8

I've recently upgraded OSX to Mountain Lion (10.8) and Xcode (4.4) and ran into issues when trying to get my rails environment working. I started with running bundle install and ran into an error when installing the libv8 library. Below is a paste of the full error. I've search around and looked for similar issues, but what I found on stackoverflow so far has not applied to my problem. Here are the few things I've tried so far with no avail:
install Xcode Command Line Tools
install MySQL
install X11
install different versions of libv8 via the gemfile
Now I'm at a point where the problem seems to be exceeding my ruby skills. If anyone has some ideas on what I can try or are experiencing a similar issue, I'd love your help. Thanks!
Here's what my gemfile looks like:
source 'https://rubygems.org'
gem 'rails', '3.2.6'
gem 'bundler'
gem 'rake'
gem 'sqlite3'
gem 'haml'
gem 'nokogiri'
gem 'whenever'
gem 'mysql'
gem 'mysql2'
gem 'jquery-rails'
gem 'capistrano'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
And here's the error log when trying to install gems:
sudo bundle install
Password:
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bundler (1.0.15)
Using highline (1.6.13)
Using net-ssh (2.5.2)
Using net-scp (1.0.4)
Using net-sftp (2.0.5)
Using net-ssh-gateway (1.1.0)
Using capistrano (2.12.0)
Using chronic (0.6.7)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.3)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Using coffee-rails (3.2.2)
Using haml (3.1.6)
Using jquery-rails (2.0.2)
Installing libv8 (3.3.10.4) with native extensions /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:445:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:445:in `build_extensions'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:197:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
Try to add
gem 'therubyracer', '0.11.0beta5'
gem 'libv8', '~> 3.11.8'
to your Gemfile. It helps for me.
This is a quick guide on how to get rails running on 10.8: http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
From the guide:
If you need to install any Ruby that’s older than 1.9.3, such as 1.9.2, 1.8.7 or REE, you’ll need to install GCC 4.2.
Okay, after some digging and seeing I'm not the only one with the problem, I've found the solution. Ultimately, it was because the 'therubyracer' gem was referencing a version of libv8 that was't compiling on Mountain Lion. The fix was to update the gem to use a beta version of the gem which uses an more recent version of libv8. Here's a link to the issue on github: https://github.com/cowboyd/therubyracer/issues/181
I kept a list of crib notes of the entire process of getting rails back up and running, and here a short list of it for anyone it might help.
Uninstall and Reinstall Brew (it wouldn't update to 0.9 with brew update, so a manual reinstall was needed)
Install GCC Compiler that is no longer included as mentioned by #Joe
- chown the /Library/Caches directory
Install MySQL
Install X11
Update Gemfile to use beta version of 'therubyracer'
gem "therubyracer", "~> 0.11.0beta5"
Fix issues with Nokigiri and LibXML conflicts as covered here:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
bundle install and win!
I have a couple of suggestions. It might help to use rvm or rbenv rather than the system version of Ruby:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Another suggestion is to use the latest version of libv8 and the pre-release version of therubyracer which will compile against it.
Although it is not updated to latest build env. (Xcode 4.4), following this answer (on question: Issue updating Ruby on Mac with Xcode 4.3.1) might help.
While Xcode version is different, basic setup is same.
I'm trying to build env with Xcode 4.4 had minor issue with specific gem(capybara-webkit) at this moment. Will update the answer.

Unable to use factory girl with Cucumber and rails 3 (bundler problem)

I'm trying to run cucumber features with factory girl factories on a fresh Rails 3 application.
Here is my Gemfile:
source "http://gemcutter.org"
gem "rails", "3.0.0.beta"
gem "pg"
gem "factory_girl", :git => "git://github.com/thoughtbot/factory_girl.git", :branch => "rails3"
gem "rspec-rails", ">= 2.0.0.beta.4"
gem "capybara"
gem "database_cleaner"
gem "cucumber-rails", :require => false
Then the bundle install commande just runs smoothly:
$ bundle install
/usr/lib/ruby/gems/1.8/gems/bundler-0.9.3/lib/bundler/installer.rb:81:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
Updating git://github.com/thoughtbot/factory_girl.git
Fetching source index from http://gemcutter.org
Resolving dependencies
Installing abstract (1.0.0) from system gems
Installing actionmailer (3.0.0.beta) from system gems
Installing actionpack (3.0.0.beta) from system gems
Installing activemodel (3.0.0.beta) from system gems
Installing activerecord (3.0.0.beta) from system gems
Installing activeresource (3.0.0.beta) from system gems
Installing activesupport (3.0.0.beta) from system gems
Installing arel (0.2.1) from system gems
Installing builder (2.1.2) from system gems
Installing bundler (0.9.13) from system gems
Installing capybara (0.3.6) from system gems
Installing cucumber (0.6.3) from system gems
Installing cucumber-rails (0.3.0) from system gems
Installing culerity (0.2.9) from system gems
Installing database_cleaner (0.5.0) from system gems
Installing diff-lcs (1.1.2) from system gems
Installing erubis (2.6.5) from system gems
Installing factory_girl (1.2.3) from git://github.com/thoughtbot/factory_girl.git (at rails3)
Installing ffi (0.6.3) from system gems
Installing i18n (0.3.6) from system gems
Installing json_pure (1.2.3) from system gems
Installing mail (2.1.3) from system gems
Installing memcache-client (1.7.8) from system gems
Installing mime-types (1.16) from system gems
Installing nokogiri (1.4.1) from system gems
Installing pg (0.9.0) from system gems
Installing polyglot (0.3.0) from system gems
Installing rack (1.1.0) from system gems
Installing rack-mount (0.4.7) from system gems
Installing rack-test (0.5.3) from system gems
Installing rails (3.0.0.beta) from system gems
Installing railties (3.0.0.beta) from system gems
Installing rake (0.8.7) from system gems
Installing rspec (2.0.0.beta.4) from system gems
Installing rspec-core (2.0.0.beta.4) from system gems
Installing rspec-expectations (2.0.0.beta.4) from system gems
Installing rspec-mocks (2.0.0.beta.4) from system gems
Installing rspec-rails (2.0.0.beta.4) from system gems
Installing selenium-webdriver (0.0.17) from system gems
Installing term-ansicolor (1.0.5) from system gems
Installing text-format (1.0.0) from system gems
Installing text-hyphen (1.0.0) from system gems
Installing thor (0.13.4) from system gems
Installing treetop (1.4.4) from system gems
Installing tzinfo (0.3.17) from system gems
Installing webrat (0.7.0) from system gems
Your bundle is complete!
When I run cucumber, here is the error I get:
$ rake cucumber
(in /home/jbpros/projects/deorbitburn)
/usr/lib/ruby/gems/1.8/gems/bundler-0.9.3/lib/bundler/resolver.rb:97:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
NOTICE: CREATE TABLE will create implicit sequence "posts_id_seq" for serial column "posts.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "posts_pkey" for table "posts"
/usr/bin/ruby1.8 -I "/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/lib:lib" "/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/cucumber" --profile default
Using the default profile...
git://github.com/thoughtbot/factory_girl.git (at rails3) is not checked out. Please run `bundle install` (Bundler::PathError)
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/source.rb:282:in `load_spec_files'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/source.rb:190:in `local_specs'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:36:in `runtime_gems'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:35:in `each'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:35:in `runtime_gems'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/index.rb:5:in `build'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:34:in `runtime_gems'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:14:in `index'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/index.rb:5:in `build'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:13:in `index'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:55:in `resolve_locally'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:28:in `specs'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:65:in `specs_for'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/environment.rb:23:in `requested_specs'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler/runtime.rb:18:in `setup'
/home/jbpros/.bundle/gems/bundler-0.9.13/lib/bundler.rb:68:in `setup'
/home/jbpros/projects/deorbitburn/config/boot.rb:7
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/jbpros/projects/deorbitburn/config/application.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/jbpros/projects/deorbitburn/config/environment.rb:2
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/home/jbpros/projects/deorbitburn/features/support/env.rb:8
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:85:in `load_code_file'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:77:in `load_code_files'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:76:in `each'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:76:in `load_code_files'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/cucumber:8
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.8 -I "/usr/lib/ruby/gems/1....]
(See full trace by running task with --trace)
Do I have to do something special for bundler to check out factory girl's repository on github?
on a side note you may want to include 'factory_girl_rails' instead of factory_girl in your gemfile
as this is a fix for rails 3
we found that although our factories worked with cucumber they didnt work with test:unit until we had this gem
Have you tried to run bundle pack ?
Ok I found the problem. I was running bundler 0.9.3. Upgrading to 0.9.13 and running 'bundle install` fixed everything.

Resources