Forum: Ruby on Rails Having problems with rake?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-09 13:28
I am a total newbie to Rails and Ruby. I have the Agile Web Development
with Rails book and am following through the first few chapters. I got
to the "Creating you own Rails API Documentation" and followed the
following steps.

rails dummy_app
cd dummy_app

Then when I run the "rake rails:freeze:gems" command I get the following
error.

No rails gem 3.0.5.001 is installed. Do 'gem list rails' to see what you
have available.

I run this and get

*** LOCAL GEMS ***

rails (1.2.3)
    Web-application framework with template engine, control flow-layer,
and ORM.

I have tried a manual install of ruby and rails as well as using
InstantRails with the same results.

I have absolutely no clue what I am doing wrong or what could be wrong
with my setup. Help please!

Thanks
1924957eee03ddf35a65a3e8337f7f20?d=identicon&s=25 Stephan Dale (stephan)
on 2007-07-09 14:23
So you've got rails installed (same version as me in fact, though I'm on
linux). cd to your dummy_app and run rake -T to see what tasks are
available. Is 'rails:freeze:gems' listed?
1924957eee03ddf35a65a3e8337f7f20?d=identicon&s=25 Stephan Dale (stephan)
on 2007-07-09 14:32
Stephan Dale wrote:
> So you've got rails installed (same version as me in fact, though I'm on
> linux). cd to your dummy_app and run rake -T to see what tasks are
> available. Is 'rails:freeze:gems' listed?

Sorry, ignore that, it's a stupid question to ask - of course it's
available!

Looks like rake thinks your version of rails is 3.0.5.001, which I
believe it gets from the VERSION environment variable.

- Do you recognise the 3.0.5.001 version number?
- What version is returned when you run 'rails --version'?
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-09 14:34
Yup it is listed. In the list it comes up as

rake rails:freeze:gems # Lock this application to the current gems (by
unpacking them into vendor/rails)

Thanks for replying :)
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-09 14:37
I don't recognise the 3.0.5.001 version at all, that is one of the
things I find very confusing. Actually I just check the setting for
VERSION and it is in fact 3.0.5.001. rails --version returns 1.2.3. I
will change the environment variable to 1.2.3 and see how that goes. Not
sure how it got set to that in the first place?
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-09 14:42
Fantastic! I changed the VERSION variable to 1.2.3 and it worked
straight away. I have no clue where 3.0.5.001 came from. Thanks for the
help!
1924957eee03ddf35a65a3e8337f7f20?d=identicon&s=25 Stephan Dale (stephan)
on 2007-07-09 14:54
Very Confused wrote:
> Fantastic! I changed the VERSION variable to 1.2.3 and it worked
> straight away. I have no clue where 3.0.5.001 came from. Thanks for the
> help!

Glad it worked, though I'm afraid I've no idea where it came from
either! I'd guess hoe or cygwin.
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-09 14:58
Ahhhh, yes cygwin. That would be it. That didn't even cross my mind
cause I don't check versions on it very often.
32aa18dfc9703dc5dc7142c18c552e48?d=identicon&s=25 Not So Confused (confused)
on 2007-07-11 02:54
As an side I was also having some problems with db:migrate after I go
this working. It would refuse to migrate past version 2 unless I
specified VERSION=x. I found that if I cleared the VERSION environment
variable all together it solved the problem.

Is this variable meant to be set as a part of the ruby/rails
installation or is it optional to control something else? Seems to me a
bit non-specific in naming especially due to the clash with other apps
e.g. cygwin (which also should use some other variable). Perhaps a
change to RUBY_VERSION would be more suitable?

Anyway just wanted to post that the solution to my original problem was
the VERSION variable and it also caused the problem with db:migrate as
well.
1924957eee03ddf35a65a3e8337f7f20?d=identicon&s=25 Stephan Dale (stephan)
on 2007-07-11 10:34
I don't think it's anything to do with Ruby / Rails - at least I've not
got VERSION set on my system and all docs I've seen mention vars with a
RAILS_ or GEM_ prefix.

If you do a google search for 3.0.5.001, you see it mentioned alongside
products like cygwin, hoe, HP software update, DeLPSguard, etc. If
you've got any of those installed, check the version number and if it
matches you've got your culprit.
F4a73ebcc76a8a7f56214a41cbe99415?d=identicon&s=25 Jim Gagne (jimgagne)
on 2007-07-13 22:57
Hey folks, I have a different problem with Rake I'd like to ask about.

In my regular Ruby setup (on a Mac using MacPorts into the /opt/local
directory), I can't run either "rake rails:freeze:gems" or "gem_server"
without getting an error. It's missing a file that is nowhere on my hard
drive. Here's the log:

/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- sources (LoadError)
        from
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
        from
/opt/local/lib/ruby/gems/1.8/gems/rubygems-update-0.9.4/lib/rubygems/source_info_cache.rb:6

BUT when I run either of these within Locomotive, they work fine. So for
the moment, I’m all right, because I can get at this documentation. But
does anyone know what's going on?
---Jim Gagne---
This topic is locked and can not be replied to.