0

I am writing a small blog application using Rails. I am using Aptana Studio.

When I try to execute:

ruby script/generate scaffold post title:string body:text

from either Aptana Studio or going to the project folder and executing it from the shell, I get this error:

c:\Ruby200\bin\ruby.exe: No such file or directory -- script/generate (LoadError
)

1 Answer 1

3

I think you are meaning to do rails generate?

First create a new Rails app:

rails new random_app
cd random_app
rails generate scaffold post title:string body:text

When you "ruby" something, it looks for a file to execute.

Rails is the framework for abstraction and scaffolding.

See "Why does Ruby "script/generate" return "No such file or directory"?".

Rails 3 is the problem. Since Rails 3, all of the "script/whatever" commands have been replaced with "rails whatever".

So now you want rails generate ... or rails server instead.

Sign up to request clarification or add additional context in comments.

5 Comments

The blog I am referring to is using ruby script/generate. sixrevisions.com/web-development/…
that blog is outdated, ruby script/generate has been replaced with rails commands. see the link the above answer
Ok. Thanks. Can you suggest any new link which illustrates how to create a blog using Rails?
guides.rubyonrails.org this is the best site. they have a blog tutorial similar to the one that you were looking at, guides.rubyonrails.org/getting_started.html
Thanks a lot James. It helped much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.