Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Craig Booker
Craig Booker
14,968 Points

Rails > Bundler Issue

So apparently, an update in Rails 4 and bundler breaks --binstubs. I now get this error.

Looks like your app's ./bin/rails is a stub that was generated by Bundler.

In Rails 4, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand.

Here's how to upgrade:

bundle config --delete bin # Turn off Bundler's stub generator rake rails:update:bin # Use the new Rails 4 executables git add bin # Add bin/ to source control

You may need to remove bin/ from your .gitignore as well.

When you install a gem whose executable you want to use in your app, generate it and add it to source control:

bundle binstubs some-gem-name git add bin/new-executable

WARN: Unresolved specs during Gem::Specification.reset: multi_json (~> 1.3) rake (>= 0.8.7) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. /usr/local/rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in block in setup': You have already activated i18n 0.6.4, but your Gemfile requires i18n 0.6.1. Using bundle exec may solve this. (Gem::LoadError) from /usr/local/rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:insetup' from /usr/local/rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb:120:in setup' from /usr/local/rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in<top (required)>' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:inrescue in require' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in require' from /Users/craig/Projects/PartFindr/pf_web_app/config/boot.rb:6:in<top (required)>' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:inrequire' from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/app_rails_loader.rb:42:in block in exec_app_rails' from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/app_rails_loader.rb:32:inloop' from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/app_rails_loader.rb:32:in exec_app_rails' from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/cli.rb:6:in<top (required)>' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:inrequire' from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/bin/rails:9:in <top (required)>' from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/rails:23:inload' from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/rails:23:in `<main>'

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Craig Booker we don't have videos for Rails 4 yet. You are likely to encounter a lot of errors when trying to upgrade a rails app to rails 4. Sorry about that!

Kang-Kyu Lee
Kang-Kyu Lee
52,045 Points

Hello Teacher Jason Seifer, thank you - however I'm trying to go with this (Treehouse Island) treebook project but it didn't seem to go on at some point, so I downloaded project file and tried there

~'''ruby gem uninstall rake -v 10.1.1 bundle install '''

and also here rails version 3.2.6, and rake version 9.2.2.2 (same as Gemfile.lock) but it goes like this

'''rake db:migrate''' gets error message "you have already activated rake 0.9.6, but your Gemfile requires rake 0.9.2.2." so I tried then '''gem uninstall rake -v 0.9.6" and it gets error message "gem "rake" cannot be uninstalled because it is a default gem."

So actually I'm stuck here. I don't have idea about another message "Using bundle exec may solve this." Anyways please help me, when you have a moment. Thank you again.

Craig Booker
Craig Booker
14,968 Points

Okay, just downgraded the version I am using until I have a greater understanding of Rails 4.

Kang-Kyu Lee
Kang-Kyu Lee
52,045 Points

************Sorry - I put comment double.. but I only tried edit my question!

Hello Teacher @Jason Seifer, thank you - however I'm trying to go with this (Treehouse Island) treebook project but it didn't seem to go on at some point, so I downloaded project file and tried there

ruby gem uninstall rake -v 10.1.1 
bundle install

and also here rails version 3.2.6, and rake version 9.2.2.2 (same as Gemfile.lock) but it goes like this

rake db:migrate gets error message "you have already activated rake 0.9.6, but your Gemfile requires rake 0.9.2.2." so I tried then gem uninstall rake -v 0.9.6 and it gets error message "gem "rake" cannot be uninstalled because it is a default gem."

So actually I'm stuck since. I don't have idea about another message "Using bundle exec may solve this." Anyways please help me, when you have a moment. Thank you again.