Rails root directory??

  • Problem
  • Updated 4 years ago
  • Solved
Section 4.4.5 says to place the example.user.rb file in the Rails root directory. On my Ubuntu box, that should be /usr/lib/ruby/1.8/gems/1.8/rails-2.3.5 However, when I go into my sample_app and script/console. I get no such file found when following the instructions for require....
Photo of tony.dunsworthT

tony.dunsworth

  • 4 Posts
  • 0 Likes
  • flustered

Posted 5 years ago

  • 1
Photo of tony.dunsworthT

tony.dunsworth

  • 4 Posts
  • 0 Likes
Never mind, I fixed it. It was a naming issue. Fat fingered it
Photo of Rails Tutorial

Rails Tutorial, Official Rep

  • 1009 Posts
  • 112 Likes
Just to make sure you got it: as noted in Section 1.1.3, "Rails root" refers to the root directory of the application, not Rails itself. The value will depend somewhat on your system; for example, my Rails root for the first application is /Users/mhartl/rails_projects/first_app.
Photo of carl

carl

  • 28 Posts
  • 0 Likes
i did the same thing here .. was about to post about it ... perhaps it would be a good idea to notate the above on the 4.4.5 section ... bc i was looking to palce this in usr/lib/etc ... instead of ~/rails_projects/sample_app
Photo of Rails Tutorial

Rails Tutorial, Official Rep

  • 1009 Posts
  • 112 Likes
Thanks for the extra data point. I've added a parenthetical note in that section for clarity.
Photo of dlim01D

dlim01

  • 1 Post
  • 0 Likes
When i put it into my /rails_projects/sample_app folder, I kept getting a file not found in my console.

I had to navigate to /rails_projects/sample_app/app/controllers/
folder inorder for the file to be found by the rails console
Photo of Rails Tutorial

Rails Tutorial, Official Rep

  • 1009 Posts
  • 112 Likes
Try writing require './example_user.rb' in the console and see if that works.