DevHeads.net

Postings by Barry Kimelman

ruby rookie needs help with mtime method of File

I was looking at an example of the "mtime" method for a file and when I ran
the example I received the following traceback

C:\barry\ruby>ruby dir3-glob.rb
backtick1.rb
Traceback (most recent call last):
2: from dir3-glob.rb:3:in `<main>'
1: from dir3-glob.rb:3:in `glob'
dir3-glob.rb:6:in `block in <main>': undefined method `mtime' for
"backtick1.rb":String (NoMethodError)

The source of my script is as follows
1 #!C:\Ruby\bin\ruby.exe -w
2
3 Dir.glob("*.rb") {|file|
4 # do something with the file here
5 puts file
6 mtime = file.mtime
7 ne

ruby/rails rookie needs help to build a simple database app

I am attempting to give myself an intro to ruby and rails. I am a long time
software developer (unix, perl, c, database, web, etc...)

So far every tutorial I have tried has ended in disaster. In one case when
I go to the url listed in the tutorial I get an error and a traceback which
complains about a missing method.

rails constantly failing with http 406 error

I am a ruby and rails rookie just trying to give myself an intro to ruby
and rails on my windows 10 laptop.

Almost everything I try with rails ends up failing with a "http 406" error.
I did some research on http 406 error and what I found stated "data was
requested in a format not supported by the server".

I was just following the simple steps in a rails beginner tutorial to
create a basic "blog" application. I changed to the directory where I
wanted the application structure to be created and issued the command
"rails new blog".

rails new command dies with a strange error

I created a simple "hello world" rails app according to a tutorial I found
online. everything went ok.

Today I want to create a simple rails blog app. So I installed sqlite3
database.

ruby rookie needs help with "ri" command

I am a ruby rookie with a question

I am running ruby 2.6.0p0 (2018-12-25 revision 66547) [x64-mingw32]
my laptop is windows 10

I was going through the PDF versionb of a ruby intro book and I have a
question about the "ri" command. The PDF file shows the following examples

ri Array
ri Array.sort
ri Hash#each
ri Math::sqrt

But in each case I receive an error message of the form "Nothing known
about xxx".