# New rails edge project - step by step

**URL:** <https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050>\
**Category:** Rails\
**Created:** [November 23, 2007, 8:38am UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050 "2007-11-23T08:38:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 23, 2007, 8:38am UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050/1 "2007-11-23T08:38:24Z")

</div>

I am trying to create a new rails project in edge:

rails campus  
cd campus  
rake rails:freeze:edge  
script/generate model topic title:string body:text  
rake db:create:all  
rake db:migrate  
script/generate controller topics index new create  
rm public/index.html

I added this line to routes.rb:  
map.root :controller =\> “topics”

I type [http://localhost:3000](http://localhost:3000) and get this message:  
Status: 500 Internal Server Error Content-Type: text/html  
In the development.log I see this:  
Status: 500 Internal Server Error  
A secret is required to generate an integrity hash for cookie session  
data. Use config.action\_controller.session = { :session\_key =\>  
“\_myapp\_session”, :secret =\> “some secret phrase” } in config/  
environment.rb

what am I doing wrong?

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 23, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050/2 "2007-11-23T20:14:15Z")

</div>

If I recall correctly, that line is initially commented out. Just edit  
the config/environment.rb and remove the # in the front of that line.

That should work for you  
CW

oren wrote:

> I am trying to create a new rails project in edge:
> 
> rails campus  
> cd campus  
> rake rails:freeze:edge  
> script/generate model topic title:string body:text  
> rake db:create:all  
> rake db:migrate  
> script/generate controller topics index new create  
> rm public/index.html
> 
> I added this line to routes.rb:  
> map.root :controller =\> “topics”
> 
> I type [http://localhost:3000](http://localhost:3000) and get this message:  
> Status: 500 Internal Server Error Content-Type: text/html  
> In the development.log I see this:  
> Status: 500 Internal Server Error  
> A secret is required to generate an integrity hash for cookie session  
> data. Use config.action\_controller.session = { :session\_key =\>  
> “\_myapp\_session”, :secret =\> “some secret phrase” } in config/  
> environment.rb
> 
> what am I doing wrong?

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 23, 2007, 8:37pm UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050/3 "2007-11-23T20:37:07Z")

</div>

Hi Oren :

> what am I doing wrong?

Since it’s a new Rails project, I would use the edge rails command  
to create all the skeleton of the app, with the new shiny config/boot.rb  
the config/initializers dir and so on… and let it create the secret  
phrase  
for me.

rails campus\_tmp  
cd campus\_tmp  
rake rails:freeze:edge  
cd …  
ruby campus\_tmp/vendor/rails/railties/bin/rails campus  
mv campus\_tmp/vendor/rails campus/vendor/rails  
rm -Rfv campus\_tmp  
cd campus  
script/generate model …

# and so on

And in config/environment.rb you will have a correct  
hash for config.action\_controller.session, since Rails  
generates it for you.

– Jean-François.

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 23, 2007, 9:34pm UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050/4 "2007-11-23T21:34:40Z")

</div>

great, it works!

I would like to understand what i just did…

ruby campus\_tmp/vendor/rails/railties/bin/rails campus #what’s going  
on  
here?  
mv campus\_tmp/vendor/rails campus/vendor/rails #and here?  
rm -Rfv campus\_tmp

where can I learn about the edge/rails 2.0? (I am new to rails, just  
read  
DHH’s book).

thanks!

---

<div class="post-metadata">

**Author:** ![oren](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecd19e/32.png) [@oren](https://www.ruby-forum.com/u/oren)\
**Post date:** [November 23, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/new-rails-edge-project-step-by-step/121050/5 "2007-11-23T22:55:28Z")

</div>

Oren :

> great, it works!
> 
> I would like to understand what i just did…
> 
> ruby campus\_tmp/vendor/rails/railties/bin/rails campus  
> #what’s going on here?

We’re using the edge version of rails command to  
generate the campus project, instead of using a 1.2.\* version  
of rails command. So you’re sure that the files are up to  
date with your version (edge) of Rails. And the Rails generator  
will provide a secret phrase for you in config/environment.rb,  
so you don’t need to create one manually.

> mv campus\_tmp/vendor/rails campus/vendor/rails #and here?

Well with the previous invocation of rails:freeze:edge task,  
you’ve downloaded the edge rails source, there’s no use  
to download it twice, so we’ve just moved now in the right  
place, in the campus project structure.

> rm -Rfv campus\_tmp

We can now remove the temporary campus\_tmp project.

> where can I learn about the edge/rails 2.0? (I am new to rails,  
> just read DHH’s book).

I’m afraid that Rails edge doesn’t fit to beginners, since  
you must have a good knowledge of Rails and Rails internals,  
to be able to debug on your own.

– Jean-François.
