Rails Server, new files not live - ruby-on-rails

I'm going through a Ruby on Rails tutorial and right now it's generating controllers. (I believe I'm on the local server.. started by doing:
$rails s
When I look in TextMate, all the new files have a "no entry" sign on them, which I assume to be not live. They also don't work when I try to pull up the address.
How do I make them live?
(Edit: Picture added, also.. When I try to go to the page it says:
Routing Error
No route matches [GET] "address"
Try running rake routes for more information on available routes.

Rails should not be generating controllers.
My advise is to start all over
rails new myApp
cd myApp
rails generate scaffold Post name:string title:string content:text
rake db:migrate
rails s
At point your browser to http://localhost:3000
Then you'll see the rails welcome page
If you point the browser to http://localhost:3000/posts you'll get to the post index page
And read this rails guide
update
Are you running rails generations from another user? It looks like you don't have read and write rights to the files from textmate.

Embarrassing lesson. The server was attached to a different directory. And apparently the symbol isn't read/write.. Not sure what it is though

Related

Rails missing route

So I have a website for a class. I am creating a login for the website, so I start with
"rails generate scaffold User name:string password:digest --no-test-framework" to create the model.
I ran "rake db:migrate" to create the database.
I ran the rails server and opened chrome to check the webpage out by entering the url "localhost:3xxx/users/new" and I get a Routing error that says "No route matches [GET] "/users/new"
I did a "rake routes" to check it out and it is correct, there is no route to "/users/new".
When I ran the generate scaffold I noticed that it did say that it created the route but its not showing up!
Am I missing something?
Nevermind, I manually added get "user/new" => "users#new" to the routes.rb file and it worked!
I'm new to rails and usually whenever I use generate scaffold I never get this problem.
If anyone knows how or why the route wasn't added when I used the generate scaffold, please let me know for future reference, thanks!

rails issue with scaffold

I'm new to rails and messing around with scaffold. I generated a new one doing rails g scaffold Review artist:string venue:string date:string comments:string then ran rake db:migrate and it looks pretty weird, not how my professor's looked in class. I just opened it in my browser. Anyone able to explain to me why it looks like this? Sorry this is vague but not sure how to search for an answer online. Thanks
edit: I also tried connecting to localhost:3000 after starting my rails server, but it wouldn't load. any suggestions?
It looks like you're trying to access the file directly.
You should rather start your rails server and then access the page via the proper route, eg. http://localhost:3000/reviews

Rails demo app on local host not working

New to Rails. Everything solid through creation of demo_app, but rails server is yielding just the basic rails welcome page, not my demo application
You need to delete public/index.html and change root to: in config/routes.rb to point to your welcome page's controller action.
Well, then Rails works :)
In your console cd to the Folder where your rails app is and run
rake routes
Then try out one of the routes in your browser.
If there aren't any, you have to create routes. Follow some tutorial for this.

Error regarding ActiveAdmin in Ruby on Rails when customizing the menu

Mac OS X 10.7.3 Lion,
Ruby 1.9.2,
Rails 3.2.2,
Sass 3.2.3
Following this tutorial:
http://activeadmin.info/documentation.html
Following this video tutorial
http://www.youtube.com/watch?v=tAxlrHcEg9U
I add the activeadmin gem, run bundle install, then run
rails generate active_admin:install
rails generate active_admin:resource POST
Only after creating the app/admin/posts.rb and trying to run either
db migrate
rails server
fails with the error
uninitialized constant Post NameError
with out that posts.rb file i am able to run the admin interface error free.
I tried moving the sass-rails gem out side of the :assets in my gem file and re-running bundle install as suggested in another question, but to no avail I still have the error
according to the getting started active admin tutorial "Post" is suppose to be a module name so i assume the code above is calling a class method (ActiveAdmin as the class, register as the method) and sending the module as a parameter and the block do end
Regardless the error is implying that RoR doesn't know what Post is. As if it does not exist. Being new to rails i do not know how to navigate well, meaning i do not even know where this ActiveAdmin source file is in order to dig through it for a method Post
Thank you for the consideration and your time, I appreciate it.
The linked tutorial assumes that you have already created a model named Post (and have run rake db:migrate to link it to the database). The purpose of the rails generate active_admin:resource Post command is to tell ActiveAdmin that you want it to consider the Post model in part of what it does.
Historically, you'll see models like Post and User in Rails a lot -- these are the commonly used examples of creating a blogging application (a user can create blog posts).
So, whatever models you have in your application can be registered with ActiveAdmin by replacing Post with the name of your model.
Another note: while generators like this tend to be forgiving, a Post is a model that is defined in post.rb and is linked to a SQL table called posts. Be careful with things like upper- and lower-case, and singular and plurals. In Rails they all fit together in a special way.

Trying to learn RoR, but keep getting Page doesn't exist errors

I'm trying to learn RoR and I keep getting pesky page doesn't exist pages. I deleted the index.html file out of my public folder and created a root route in my routes file but I still am getting that error. I am running ubuntu 10.04 with mod_passenger and ruby enterprise edition.
just leave the mod_passenger until you find the error. Do like this:
open a shell
go to your Rails app directory
ruby script/server (Rails < 3).
It should start the server in your console. and browse the page you want. If you are getting an error it should display in the console.
check your database connection is OK in config/database.yml file
rake routes is the standard shell command to see all your routes. Check if url you're trying to access is in the list. If it's not, show us statement in routes.rb you use to generate this route and url you're trying to access.
Can you please paste the content of your routes.rb file?
Also, make sure you have a controller created for that page and it should contain the index action.
def index
end

Resources