Beginner "rails new" question

Hi,

I’m currently slogging my way thru the installation-setting up pages
of Ruby On Rails 3 Tutorial. I’m a bit new at terminal stuff, and am
wrapping my head around getting around hidden directories, github, ssh
keys, blah blah.

Question:
I’m trying to set up a new app with the command “rails new demo_app”.
It instead gives me a directory called “new” with the usual
directories, but not all the usual files are there, like Gemfile or
Readme. I already set up another app before successfully, where it
generated all the requisite files using my project name in the command
line (rails new first_app). I’m wondering if I switched something off
inadvertently between then and now.

Thanks for any help. (I’m sure to be back with more dumb questions)

Ian

I’m not sure about the solution but maybe:

Rails 3.0 was the first that used rails new app_name command.
Previously it was rails app_name.
Is that possible you tried first time with rails 3.0 or newer than
second time used with 2.3.x?
Maybe used the one click installer and got the older version. Maybe.
Try rails -v.

Lan,

When I try it with “rails new demo_app”, it’s succeeded in generating
all files.
Are you meaning you can not generate any files now? Even if you change
your working directory ( to other directory ) ?

Dahlby wrote in post #977579:

Hi,

I’m currently slogging my way thru the installation-setting up pages
of Ruby On Rails 3 Tutorial. I’m a bit new at terminal stuff, and am
wrapping my head around getting around hidden directories, github, ssh
keys, blah blah.

Question:
I’m trying to set up a new app with the command “rails new demo_app”.
It instead gives me a directory called “new” with the usual
directories, but not all the usual files are there, like Gemfile or
Readme.

Then you are trying to use a Rails 3 tutorial with a Rails 2 (or older)
installation. Don’t do that. Install Rails 3.

I already set up another app before successfully, where it
generated all the requisite files using my project name in the command
line (rails new first_app). I’m wondering if I switched something off
inadvertently between then and now.

Perhaps. What’s the output from rails -v ? How about gem list rails ?

Are you using RVM?

Thanks for any help. (I’m sure to be back with more dumb questions)

Ian

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Thanks for all the replies.
It looks like things changed after shutting down and starting back up
the
next day. My rails went back to version 2.3.5 for some reason. That
would
explain the different folder set I get when doing a “new” command. The
Hartl
book recommended having both Rails 2 and 3, in case I needed to switch
back
and forth.

I installed RVM but am having a frustrating time trying to get the
Terminal
to recognize the command. I’m going backwards it seems :frowning:

If I had a .bash_profile, I don’t now. I created one, put it in my home
directory, and added the suggested RVM code to it:

[[ -s “$HOME/.rvm/scripts/rvm” ]] && . “$HOME/.rvm/scripts/rvm” # This
loads RVM into a shell session.

…but Terminal still doesn’t acknowledge rvm as a command.
I don’t have a .bashrc or .profile file either. All I found in the home
directory was .bash_history.
Not sure how I got it to work on Monday.

My gem list rails is:
rails (2.3.5, 1.2.6)

I guess my initial question is answered and now am needing basic help
with
rvm. I went through the RVM site’s troubleshooting section, but it’s
still a
little technical for me.

Thanks for any further help!!

Ian

Sorry for not being explicit:

Mac OS 10.6 (snow leopard)
rails -v = 2.3.5
I think I had installed Rails 3, but it bumped me back to 2.3.5. At
least I
was going through the book’s steps successfully.

I got RVM working in terminal now. I hadn’t done “source .bash_profile”
to
load it in. That did the trick. RVM commands now work in the terminal. I
wasn’t sure if .bash_profile needed extra code in there, but it looks
like
it can just be a plain, naked text file with the one piece of RVM code
in
there. Good to know.

I installed Rails 3 (again perhaps) and now rails -v is 3.0.5.

I did my “rails new demo_app” and I got all the appropriate files this
time.

Thanks for the responsive help! I’m back on track now (or back on the
Rails,
as it were)

case closed
:slight_smile:

Ian

Please quote when replying.

Dahlby wrote in post #977793:

Thanks for all the replies.
It looks like things changed after shutting down and starting back up
the
next day. My rails went back to version 2.3.5 for some reason. That
would
explain the different folder set I get when doing a “new” command. The
Hartl
book recommended having both Rails 2 and 3, in case I needed to switch
back
and forth.

That is a great idea, but then you need to either use RVM or explicitly
specify the version.

I installed RVM but am having a frustrating time trying to get the
Terminal
to recognize the command.

What OS are you using?

I’m going backwards it seems :frowning:

If I had a .bash_profile, I don’t now. I created one, put it in my home
directory, and added the suggested RVM code to it:

[[ -s “$HOME/.rvm/scripts/rvm” ]] && . “$HOME/.rvm/scripts/rvm” # This
loads RVM into a shell session.

…but Terminal still doesn’t acknowledge rvm as a command.

How do you know? What happens when you try to use it?

I don’t have a .bashrc or .profile file either. All I found in the home
directory was .bash_history.

.bash_profile should be fine. Did you start a new shell or use “source”
to reload your profile after editing it?

Not sure how I got it to work on Monday.

My gem list rails is:
rails (2.3.5, 1.2.6)

So you don’t have Rails 3 at all, then, at least not accessible with
your current settings.

Since you neglected to quote when replying, you forgot to answer my
entire post. I asked about the output of rails -v.

I guess my initial question is answered and now am needing basic help
with
rvm. I went through the RVM site’s troubleshooting section, but it’s
still a
little technical for me.

Development is technical. That’s life. What don’t you understand?

Thanks for any further help!!

Ian

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs