1

I have this following Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.1'

group :assets do
    gem 'sass-rails', '~> 3.2.3'
    gem 'coffee-rails', '~> 3.2.1'
    gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

Running rvm version:

$ rvm --version

rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]

The generate scaffold fails with:

$ rvm all do rails generate scaffold User name:string email:string
(in /home/user/.rvm/gems/ruby-1.9.3-p0/gems/rails-0.9.5)
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /home/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
rake/gempackagetask is deprecated.  Use rubygems/package_task instead

rm -rf /tmp/demo_app/generate
rake aborted!
can't convert nil into String

Tasks: TOP => fresh_gem_rails => make_dir_structure => make_base_dirs
(See full trace by running task with --trace)

(One thing to mention that there is no Rakefile in the directory).

What does can't convert nil into String mean? (I tried to place --trace into various places onto the command line, but the messages didn't seem to change ...)

Also how do I correct the RDoc warning?

Thanks

gliptak
  • 3,592
  • 2
  • 29
  • 61
  • I found an explanation for the `RDoc` warning at http://stackoverflow.com/questions/8702504/rails-how-do-i-resolve-the-rake-rdoctask-is-deprecated-warning although it is unclear how to clear it up except by commenting lines in the Ruby source code ... – gliptak Feb 25 '12 at 14:20

1 Answers1

0

That rails-0.9.5 in /home/user/.rvm/gems/ruby-1.9.3-p0/gems/rails-0.9.5 sounds suspicious to me.

Are you sure your Rails installation isn't screwed up?

EDIT

And what's that rvm all for, anyway? I'm not an rvm guru, but from what I could gather it looks like it does something for all installed rubies, which most certainly isn't what you want here.

s.m.
  • 7,895
  • 2
  • 38
  • 46
  • OK, I removed the directory /home/user/.rvm/gems/ruby-1.9.3-p0/gems/rails-0.9.5 Now I see: `$ rvm all do rails generate scaffold User name:string email:string /home/user/.rvm/gems/ruby-1.9.3-p0/bin/rails:19:in `load': cannot load such file -- /home/user/.rvm/gems/ruby-1.9.3-p0/gems/rails-0.9.5/bin/rails (LoadError) from /home/user/.rvm/gems/ruby-1.9.3-p0/bin/rails:19:in `
    '` Somehow rails thinks to be at 0.9.5 ...
    – gliptak Feb 25 '12 at 14:33
  • @gliptak: no no no, it's that `rvm all` that doesn't sound right, read my edit. Why are you using it? Why aren't you just using `rails generate ...`? – s.m. Feb 25 '12 at 14:35
  • There seems to be no rails in /home/user/.rvm/bin (although there is bundle and rake executables). I'm reinstalling rvm. – gliptak Feb 25 '12 at 14:45
  • I second @s.m.'s comment. You don't need to execute `rvm do`, and there shouldn't be a `rails` executable in `~/.rvm/bin`. You just need to execute `rvm use` before you run the Rails generator and all your Ruby/Rails commands will use the correct Ruby (and gemset if you specify one). – Brandan Feb 25 '12 at 16:16
  • Reinstalled rvm. I might have missed (re)running $ rvm alias create default ruby-1.9.3-p125 – gliptak Feb 25 '12 at 17:39