-2

I'm trying to get up and running following a tutorial but I had tried using the Hartl book about 2 years ago unsuccessfully so now I have all these different things installed that I have no idea where they are, what they are, or how to get rid of them. I don't even remember everything I've installed. I'm on OSX 10.6.8

The tutorial said to do rails new issues so I did that and it said I should see a bunch of things created and then a bundler. I didn't see the bundler. I found some instructions on another SO post and followed them to get this error:

xxxx-xxxx-macbook-pro:issues Ryan$ bundle install
Fetching gem metadata from http://rubygems.org/...........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.1) ruby depends on
  bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.3.5)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Now if I do rails -v I get this:

/Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/resolver.rb:130:in `block in resolve': Bundler could not find compatible versions for gem "bundler": (Bundler::VersionConflict)
In Gemfile:
rails (= 3.0.1) ruby depends on
  bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.3.5)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/resolver.rb:128:in `catch'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/resolver.rb:128:in `resolve'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
from /Users/Ryan/.rvm/gems/ruby-1.9.2-p318@rails3tutorial/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
from /Library/firstapp/issues/config/boot.rb:8:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/rails:5:in `<main>'

Another SO topic said to see if I have to bundlers installed:

xxxxx-xxxx-macbook-pro:issues Ryan$ gem list bundler
*** LOCAL GEMS ***
bundler (1.3.5, 1.0.22)

So then since 1.0.22 said its being used I removed the 1.3.5

xxxx-xxxx-macbook-pro:issues Ryan$ gem uninstall bundler -v 1.3.5
Successfully uninstalled bundler-1.3.5

Regardless of whether or not I update this I'm getting errors.

I'm so lost. I think rails3tutorial is from over a year ago when I tried that Hartl book and firstapp is where I was trying to put the tutorial I'm now trying. If anyone has any clues I would really love to figure this out. Maybe one day I'll even be able to get past the setup and do something productive on Ruby On Rails.

Ryan
  • 699
  • 4
  • 13
  • 30

2 Answers2

1

The problem i propably your outdated rails version (you are using 3.0, with 3.2 being the current version). As a general advice: Try to use the latest version of every gem.

To update your gems/ruby, do a

rvm get stable # see the note at the bottom, if that does not work
rvm install 1.9.3 # may take some time
rvm use 1.9.3 --default
gem install bundler
gem install rails
rails new issues

Note: If rvm get stable does not work, have a look at this SO answer.

Community
  • 1
  • 1
tessi
  • 13,313
  • 3
  • 38
  • 50
  • is `gem update` different from `gem update --system`? I thought these were the same and had done with `--system` on it. – Ryan May 02 '13 at 23:04
  • `gem update --system` updates the RubyGems software, but not your gems. – tessi May 02 '13 at 23:08
  • Doing the `gem update` got "railties executable "rails" conflicts with rails, overwrite this executable" I don't know what railties is. Do I want to overwrite? – Ryan May 02 '13 at 23:18
  • As your gem setup is messed up anyways, I think it's worth a try. It might be easier, though, to update to a new rails version, or create a fresh gemset to work with. `rvm gemset create a_name` and then `rvm use 1.9.3#a_name`. Then do a fresh install of bundler and rails. – tessi May 02 '13 at 23:22
  • Thanks I did the overwrite then followed all of your steps above. Had an issue with `gem install rails` not finding `lib` but found the answer `gem install rdoc` and after doing that did `gem install rails` again and it worked and then `rails new issues` worked. – Ryan May 03 '13 at 00:03
0

Lucky for you, you're using RVM! You can start with a clean slate and not worry about resolving old dependencies. You can install 1.9.3 (you're on 1.9.2), create a clean gemset, and follow the updated tutorial for 3.2 or 4.0. Let me know if you need help with any of this.

You will do something productive with Rails. Persistence is important.

hlh
  • 1,992
  • 15
  • 24
  • I had read this previously but wasn't sure if it applied to me or not. http://stackoverflow.com/questions/4907668/removing-all-installed-gems-and-starting-over so you think I should do the answer that was marked correct? – Ryan May 02 '13 at 23:07
  • I don't think you need to remove anything (unless you want to). If you install a newer version of ruby with RVM and create a new gemset for your Rails project, you'll have a completely clean slate to start with. All Ruby versions are in their own environment. – hlh May 02 '13 at 23:13