views:

201

answers:

2

Hello Everybody,

I'm very new to Rails, so please forgive my lack of understanding. I've installed the latest versions of RubyGems, Ruby, Rails, Rake, and MySQL etc via RubyGems, but I have this problem when starting to make a basic Rails app:

Icarus:temporary atg$ rails new people
    ... (output omitted) ...
Icarus:temporary atg$ cd people
Icarus:people atg$ rake db:create
(in /Users/atg/temporary/people)
rake aborted!
uninitialized constant Bundler
/Users/atg/temporary/people/Rakefile:4
(See full trace by running task with --trace)
Icarus:people atg$ rake db:create --trace
(in /Users/atg/temporary/people)
rake aborted!
uninitialized constant Bundler
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
/Users/atg/temporary/people/config/boot.rb:9
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/atg/temporary/people/config/application.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/atg/temporary/people/Rakefile:4
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/atg/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

I have no idea what I did wrong, and I'm so new to this that I don't know that I could debug it if I spent my whole life working on it -- any ideas / guidance?

All help is appreciated and thanks in advance!

+1  A: 

Bundler is the new dependencies management system for Ruby apps, and is used in new Rails projects.

# ask rubygems to install bundler
$ gem install bundler

# ask bundler to install your app's dependencies
$ bundle install

# run your app & tasks using bundler
$ bundle exec rake db:create
Justice
I tried that, got the following output: http://pastebin.com/9qxBdFVP
adam_0
Paste the contents of `Gemfile` as well.
Justice
Gemfile: http://pastebin.com/jGYG37yR
adam_0
Seems like it ought to work now. Possibly a Bundler issue (http://github.com/carlhuda/bundler/issues). Since these are the later Rails 3 and Bundler release, now that you installed Bundler and bundle-installed the app's dependencies, see if it's any different with just `rake db:create` without the `bundle exec` prepended.
Justice
Nope, I get the exact same thing with `rake db:create`
adam_0
+1  A: 

I would recommend starting with Rails 2.3.8 if this is your first experience. There are many tutorials and wider support; 3.0 is fairly fresh with several major changes. You'll be able to upgrade from 2.3.8 to 3.0.0 eventually anyway.

Nick
How would I go about downgrading, then?
adam_0
It appears that I have rails 2.3.8 installed as well as 3.0.0? When I run `gem list` I get `rails (3.0.0, 2.3.8)` as one of the lines. Does this mean that I can select which version of rails I want to be active?
adam_0
`rails _2.3.8_ people`
BenB