Sadaf_N
December 27, 2015, 11:40am
1
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
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 .
now its become error
ExecJS::ProgramError in Users#index
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
Application Trace http://localhost:3000/users# | Framework Trace
http://localhost:3000/users# | Full Trace
http://localhost:3000/users#
app/views/layouts/application.html.erb:5:in
`_app_views_layouts_application_html_erb___615946876_51123720’
http://localhost:3000/users#
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’
gem ‘therubyracer’, platforms: :ruby
Use jquery as the JavaScript library
gem ‘jquery-rails’
Turbolinks makes following links in your web application faster. Read
more: GitHub - turbolinks/turbolinks-classic: Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
gem ‘turbolinks’
Build JSON APIs with ease. Read more:
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]
On 28 December 2015 at 08:21, willy wang [email protected] wrote:
hai , when i wanna open localhost:3000/toy_app
show like this
What happens if you open localhost:3000
Colin
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
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
On 28 December 2015 at 08:38, willy wang [email protected] 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
On 28 December 2015 at 09:13, willy wang [email protected] wrote:
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
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
ToyApp
<%= stylesheet_link_tag 'application', media: 'all',
'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' =>
true %>
<%= csrf_meta_tags %>
<%= yield %>
Kindly regards
Willy Wang
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 :
ruby-on-rails
thanks pal
but did u know why must delete the js script ?
On Mon, Dec 28, 2015 at 5:29 PM, willy wang [email protected]
wrote:
<%= stylesheet_link_tag ‘application’, media: ‘all’,
Kindly regards
Willy Wang
–
Kindly regards
Willy Wang
On 28 December 2015 at 09:37, willy wang [email protected] 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