ask ruby LOCALHOST

51 views
Skip to first unread message

willy wang

unread,
Dec 27, 2015, 5:40:25 AM12/27/15
to Ruby on Rails: Talk
hello there,
im willy, i just trying use ruby for first time
a have problem when i make directory,

i follow the video tutor from M. Hartl , i can open the localhost:3000
but when i go deeper and make directory D:\RailsInstaller\toy_app\app\views\users

i open localhost:3000/users and show like this

Routing Error

No route matches [GET] "/Users"

Rails.root: D:/RailsInstaller/toy_app


any advice ?

sry bad english


jel...@gmail.com

unread,
Dec 27, 2015, 8:28:37 AM12/27/15
to rubyonra...@googlegroups.com
It looks like you created a view folder but do not have a controller action or route to match. You'll want to setup a route on config/routes.rb to match a controller action. The tutorial should walk you through this but you can also see the routing guide in the rails guides on rubyonrails.org
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c48cfac1-6d52-4a6b-bbd2-1d58b0baea03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

willy wang

unread,
Dec 28, 2015, 3:21:40 AM12/28/15
to Ruby on Rails: Talk
hai , when i wanna open localhost:3000/toy_app
show like this


its my routes
Rails.application.routes.draw do
  get 'toyapp/index'

  resources :users

it's my toyapp_controller
class ToyappController < ApplicationController
  def index
  end
end

gem file
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]



Colin Law

unread,
Dec 28, 2015, 3:36:07 AM12/28/15
to Ruby on Rails: Talk
On 28 December 2015 at 08:21, willy wang <willy...@gmail.com> wrote:
> hai , when i wanna open localhost:3000/toy_app
> show like this

What happens if you open localhost:3000

Colin

willy wang

unread,
Dec 28, 2015, 3:38:24 AM12/28/15
to Ruby on Rails: Talk
Hello Colin

its show ruby welcome aboard

Welcome aboard
You’re riding Ruby on Rails!
About your application’s environment

i'm using windows 7,

W.Wang

Colin Law

unread,
Dec 28, 2015, 3:43:08 AM12/28/15
to Ruby on Rails: Talk
On 28 December 2015 at 08:38, willy wang <willy...@gmail.com> wrote:
> Hello Colin
>
> its show ruby welcome aboard

When you run rails s it starts the server for the app in that folder,
so the welcome aboard page is coming from that app.

Colin

willy wang

unread,
Dec 28, 2015, 4:13:33 AM12/28/15
to Ruby on Rails: Talk
yes it working when i wanna just localhost:3000
but when i wanna open dir app ..app/view/users

thats gonna show

 Showing D:/RailsInstaller/toy_app/app/views/layouts/application.html.erb where line #5 raised:

TypeError: Object doesn't support this property or method

Rails.root: D:/RailsInstaller/toy_app

any advice ?
i follow the instruction ruby on capter toyapp

Colin Law

unread,
Dec 28, 2015, 4:24:55 AM12/28/15
to Ruby on Rails: Talk
On 28 December 2015 at 09:13, willy wang <willy...@gmail.com> wrote:
> yes it working when i wanna just localhost:3000
> but when i wanna open dir app ..app/view/users
>
> thats gonna show
>
>> Showing D:/RailsInstaller/toy_app/app/views/layouts/application.html.erb
>> where line #5 raised:
>>
>> TypeError: Object doesn't support this property or method
>>
>> Rails.root: D:/RailsInstaller/toy_app

Which version of rail (rails -v) and ruby (ruby -v) are you using and
which versions does the tutorial expect?

Also copy/paste the offending file
(app/views/layouts/application.html.erb) here.

Colin

willy wang

unread,
Dec 28, 2015, 4:29:37 AM12/28/15
to rubyonra...@googlegroups.com
rails version 4.2.5
ruby version 2.1.5p273 (2014-11-13 revision 48405)
tutorial suggest rails v is 4.2.0

here the app/views/layouts/application.html.erb

<!DOCTYPE html>
<html>
<head>
<title>ToyApp</title>
<%= stylesheet_link_tag 'application', media: 'all',
'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>



Kindly regards
Willy Wang

willy wang

unread,
Dec 28, 2015, 4:37:52 AM12/28/15
to rubyonra...@googlegroups.com
hai Colin

it's can be work now, with remove the JS script

<%= stylesheet_link_tag 'application', media: 'all',
'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

scourge : http://stackoverflow.com/questions/20751397/basic-hello-rails-not-working

thanks pal

but did u know why must delete the js script ?
--


Kindly regards
Willy Wang

Colin Law

unread,
Dec 28, 2015, 5:05:31 AM12/28/15
to Ruby on Rails: Talk
On 28 December 2015 at 09:37, willy wang <willy...@gmail.com> wrote:
> hai Colin
>
> it's can be work now, with remove the JS script
>
> <%= stylesheet_link_tag 'application', media: 'all',
> 'data-turbolinks-track' => true %>
> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
>

In the stackoverflow question it says the error is in
welcome.js.coffee which you did not tell us here (assuming your error
was the same). The suggestion there is that it is a windows issue, in
which case definitely the best thing is to switch to a linux
distribution such as Ubuntu. Very few developers use Windows for
Rails and you will find it difficult to get help.

You might like to try the railstutorial.org tutorial (which is free to
use online) as it will run in the cloud and does not need you to
install anything. Then when you have done that you will have a better
idea of the issues.

Colin
Reply all
Reply to author
Forward
0 new messages