Forum: Ruby on Rails Agile Rails book code fails page 32

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
106c67712ede3c2b364013fde99e63b7?d=identicon&s=25 Michael Boatrower (Guest)
on 2006-02-25 04:51
(Received via mailing list)
Starting Agile Web Development with Rails, page 32, everything has
worked
well so far but on (book not pdf) page 32 I don't get the "Template Is
Missing" error. I get

Routing Error

Cannot load config/routes.rb:
    No such file to load -- ./demo/script/../config/../config/routes.rb

There is a file at e:\ruby\ror\work\demo\config\routes.rb

It's all greek to me and of course the book assumes that it all works.
Any
help appreciated. I've tried many different paths besides the suggested
http://localhost:3000/say/hello and nothing works better. Creating the
rhtml
file in views doesn't change anything.
--
View this message in context:
http://www.nabble.com/Agile-Rails-book-code-fails-...
Sent from the RubyOnRails Users forum at Nabble.com.
C143acf82f94860ef6e2cba52b2de831?d=identicon&s=25 Greg MacGregor (Guest)
on 2006-02-25 05:39
(Received via mailing list)
Strange stuff ... didn't fail for me there. Try deleting the whole app
and
starting fresh. Could be a fluke occurence ...

Greg

On 2/24/06, Michael Boatrower <pitterpattern@yahoo.com> wrote:
>
> Sent from the RubyOnRails Users forum at Nabble.com.
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



--
Greg MacGregor
Web Developer
416-516-0395
www.sixminutes.ca
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-25 06:55
(Received via mailing list)
On Fri, 2006-02-24 at 19:49 -0800, Michael Boatrower wrote:
>
> It's all greek to me and of course the book assumes that it all works. Any
> help appreciated. I've tried many different paths besides the suggested
> http://localhost:3000/say/hello and nothing works better. Creating the rhtml
> file in views doesn't change anything.
----
http://books.pragprog.com/titles/rails/errata

Craig
106c67712ede3c2b364013fde99e63b7?d=identicon&s=25 Michael Boatrower (Guest)
on 2006-02-25 07:40
(Received via mailing list)
Yes I checked the errata before posting and couldn't find any ref to
this.
--
View this message in context:
http://www.nabble.com/Agile-Rails-book-code-fails-...
Sent from the RubyOnRails Users forum at Nabble.com.
106c67712ede3c2b364013fde99e63b7?d=identicon&s=25 Michael Boatrower (Guest)
on 2006-02-25 07:46
(Received via mailing list)
I del'd the demo hive and rebuilt it. I recieve this error now (I did
too
before attempting to adjust, adjusting produced the original error I
posted)

Routing Error

No route for path: "say/hello"

Failure reasons:
<ActionController::Routing::Route ":controller/service.wsdl" when
{:action=>"wsdl"}> failed because no controller found at subpath
say/hello
<ActionController::Routing::Route ":controller/:action/:id" ||
{:id=>nil,
:action=>"index"}> failed because no controller found at subpath
say/hello

This is perhaps a more clueful error msg. It's still not the err
expected
per the book. The file "say_controller.rb" does exist in controllers and
it
has the

def hello
end

which the book asks for. I'm on windows, maybe that makes the server
behave
a bit differently?
--
View this message in context:
http://www.nabble.com/Agile-Rails-book-code-fails-...
Sent from the RubyOnRails Users forum at Nabble.com.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-25 07:46
(Received via mailing list)
On Fri, 2006-02-24 at 22:40 -0800, Michael Boatrower wrote:
> Yes I checked the errata before posting and couldn't find any ref to this.
----
I was referring you to the note that apparently references p57

#2295: The 'gotcha' notes (3,4,& 5) are useful. You might consider
adding another...

If you get Routing Error: Recognition failed for '/admin', make sure
that you're starting WEBrick from the depot folder and not the demo
folder.--Jason

But if I recall myself (and it's been a few weeks...I didn't get that
same error message either and just pushed on)

Craig
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-25 07:49
(Received via mailing list)
On Fri, 2006-02-24 at 22:45 -0800, Michael Boatrower wrote:
> <ActionController::Routing::Route ":controller/:action/:id" || {:id=>nil,
> a bit differently?
----
maybe - but not for this.

Did you stop webrick and cd to the correct directory and start webrick
again...you need to do that - you must run webrick from the proper
location for it to 'route' correctly.

Craig
106c67712ede3c2b364013fde99e63b7?d=identicon&s=25 Michael Boatrower (Guest)
on 2006-02-25 08:16
(Received via mailing list)
Thanks Craig

Yes I stopped webbrick. But no I had just repeated the prev path...I'd
started from the work dir and use command

  ruby demo/script/server

Moving to the demo dir and using

  ruby script/server

made it work as expected. Thanks for the pointer. On the next page when
creating the Say controller they mention that one should be in the demo
dir.
--
View this message in context:
http://www.nabble.com/Agile-Rails-book-code-fails-...
Sent from the RubyOnRails Users forum at Nabble.com.
106c67712ede3c2b364013fde99e63b7?d=identicon&s=25 Michael Boatrower (Guest)
on 2006-02-25 18:00
(Received via mailing list)
To settle this in my head a bit, the reason the server must be started
in the
project folder is because webbrick is acting as a simple dev server;
thus
the shortened urls to execute the scripts?
--
View this message in context:
http://www.nabble.com/Agile-Rails-book-code-fails-...
Sent from the RubyOnRails Users forum at Nabble.com.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-25 18:27
(Received via mailing list)
On Sat, 2006-02-25 at 08:59 -0800, Michael Boatrower wrote:
> To settle this in my head a bit, the reason the server must be started in the
> project folder is because webbrick is acting as a simple dev server; thus
> the shortened urls to execute the scripts?
----
No the reason is that the routes all stem from the base directory (which
in reality is path_to_rails_app/public and thus the
path ../app/controller is the cgi path) so if you run the script/server
that is the proper one for your application, you don't need to fix any
routes (paths to the files for your webserver, in this case
script/server is your web server).

The end result of default routes wouldn't change if you were to use say
Apache or lighttpd or Mongrel or whatever as your web server. Nor should
they change if you go from development to production environment.

Craig
6122ae139470e3776aa36316296f87a3?d=identicon&s=25 Cynthia Kiser (Guest)
on 2006-02-26 02:17
(Received via mailing list)
On 2/25/06, Craig White <craigwhite@azapple.com> wrote:
> No the reason is that the routes all stem from the base directory (which
> in reality is path_to_rails_app/public and thus the
> path ../app/controller is the cgi path) so if you run the script/server
> that is the proper one for your application, you don't need to fix any
> routes (paths to the files for your webserver, in this case
> script/server is your web server).

I wish there were a way to change that. Having to start all my
development servers from WITHIN the path_to_rails_app directory means
that all my servers show up in 'ps' as "ruby script/server -p
someport" so I need to fire up a web browser to match ports to servers
instead of being able to restart the server I want by looking at the
output of ps.
--
Cynthia Kiser
cynthia.kiser@gmail.com
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-26 02:41
(Received via mailing list)
On Sat, 2006-02-25 at 17:14 -0800, Cynthia Kiser wrote:
> that all my servers show up in 'ps' as "ruby script/server -p
> someport" so I need to fire up a web browser to match ports to servers
> instead of being able to restart the server I want by looking at the
> output of ps.
----
well - that's more like a user issue

if you start it with full path, you will know which one it is from ps...

ruby script/server -e development -p 8000

or

ruby /home/craig/ruby-db/th-db/script/server -e development -p 8100

will give entirely different results in...

ps aux|grep script

Craig
6c4f98dfc3a8f078636e1130d832af48?d=identicon&s=25 Kevin Price-Ward (Guest)
on 2006-04-12 02:00
I'm working through the book 'Agile web development with rails' and have
come upon the Routing error issue in the code on page 57. I've googled
this and found a lot of reference to starting the server from the
correct directory... which I am doing, but I'm still not seeing
anything. Seems like scaffold has ignored the Admin parameter as I don't
have admin_controller.rb in my apps/controllers directory. Here's the
output of my ruby script/generate scaffold Product Admin:

./script/../config/../config/environment.rb:8: warning: already
initialized constant RAILS_GEM_VERSION
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/admin
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
      create    app/models/product.rb
      create    test/unit/product_test.rb
      create    test/fixtures/products.yml
No such file or directory - /tmp/mysql.sock

Any ideas? Should I go back to previous versions of Ruby and Rails, I'm
currently on latest of both.

Many thanks
Kevin
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-04-12 03:59
(Received via mailing list)
On Wed, 2006-04-12 at 02:00 +0200, Kevin Price-Ward wrote:
>       exists  app/controllers/
> No such file or directory - /tmp/mysql.sock
>
> Any ideas? Should I go back to previous versions of Ruby and Rails, I'm
> currently on latest of both.
----
you should be ok - check out the errata page for your version of the
book...

http://books.pragprog.com/titles/rails/errata

Craig
6c4f98dfc3a8f078636e1130d832af48?d=identicon&s=25 Kevin Price-Ward (Guest)
on 2006-04-12 10:53
Hmmm,

The only note on the errata link for page 57 says 'make sure you start
webrick from the right folder' - I'm in the depot directory when I run
'ruby script/server' - so I think that's OK.

It also says: "#2295: The 'gotcha' notes (3,4,& 5) are useful." - what
are the gotcha notes (I'm probably being really thick, so please forgive
me if it's completely obvious).

Regards
Kevin
6c4f98dfc3a8f078636e1130d832af48?d=identicon&s=25 Kevin Price-Ward (Guest)
on 2006-04-12 14:11
Kevin Price-Ward wrote:
> Hmmm,
>
> The only note on the errata link for page 57 says 'make sure you start
> webrick from the right folder' - I'm in the depot directory when I run
> 'ruby script/server' - so I think that's OK.
>
> It also says: "#2295: The 'gotcha' notes (3,4,& 5) are useful." - what
> are the gotcha notes (I'm probably being really thick, so please forgive
> me if it's completely obvious).
>
> Regards
> Kevin

Could it be that my mySQL version is old? I'm still on version 3.23.58 -
probably not, but it's just a thought!

Regards
Kevin
3e800077e83133acc2fac4f68c6507c4?d=identicon&s=25 fbollon (Guest)
on 2006-04-12 14:31
(Received via mailing list)
I had the same error message few days ago
check in database.yml if the path for mysql.sock is ok
I can not be more precis because I don't have RoR installed on my
computer at work ( for the moment ;-) )
6c4f98dfc3a8f078636e1130d832af48?d=identicon&s=25 Kevin Price-Ward (Guest)
on 2006-04-15 16:14
Hi,

I checked database.yml, couldn't see any reference to mysql.sock but it
did say to run this installation: gem install mysql - here's the output
when I tryed:
-----------------------------------------------------------------------------
[root@ns config]# gem install mysql
Attempting local installation of 'mysql'
Local gem file not found: mysql*.gem
Attempting remote installation of 'mysql'
Updating Gem source index for: http://gems.rubyforge.org
Building native extensions.  This could take a while...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib
ERROR:  While executing gem ... (RuntimeError)
    ERROR: Failed to build gem native extension.
Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
  ruby extconf.rb install mysql\nchecking for mysql_query() in
-lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no


Results logged to
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
-----------------------------------------------------------------------------
Anyone got any ideas what's going on here?

Kind regards
Kevin
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-04-15 16:30
(Received via mailing list)
On Sat, 2006-04-15 at 16:14 +0200, Kevin Price-Ward wrote:
> Updating Gem source index for: http://gems.rubyforge.org
>         --without-opt-include=${opt-dir}/include
>         --without-mysql-dir
>         --with-zlib
>         --without-mysqlclientlib
> checking for main() in -lsocket... no
> checking for mysql_query() in -lmysqlclient... no
> checking for main() in -lnsl... yes
> checking for mysql_query() in -lmysqlclient... no
>
>
> Results logged to
> /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
> -----------------------------------------------------------------------------
> Anyone got any ideas what's going on here?
-----
Looks like you don't have the necessary mysql client packages installed.
On a Red Hat/Fedora system, you would want to install the mysql package
and the mysql-devel package (and the server package if the system was
also the mysql server).

Craig
35594c037eba2fa48f7129d5fded828b?d=identicon&s=25 Peter Szinek (Guest)
on 2006-04-15 17:10
(Received via mailing list)
Craig White wrote:
>> Attempting remote installation of 'mysql'
>>         --with-opt-include
>>         --with-mysql-dir
>>         --without-mysqlclientlib
>>         --with-mysqlclientlib
>> checking for mysql_query() in -lmysqlclient... no
> -----
I just had the same 2 days ago. Make sure you have make installed (i did
not - i am running on ubuntu, and here e.g. you have to apt-get install
build-essential to have even make). Check also gcc. If this still does
not help (but i think it will), check the versions of mysql-client,
mysql-server etc.
Let me know if it works!

HTH,

Peter
43ec5998360a0cc21b51afef1781e9c0?d=identicon&s=25 Daniel Higginbotham (Guest)
on 2006-04-15 20:18
(Received via mailing list)
I had this same problem yesterday, and ran the following command to
install
the gem:

sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql


Obviously, though, --with-mysql-dir should be the directory of your
actual
mysql installation
This topic is locked and can not be replied to.