Forum: Ruby on Rails Even a simple rails app won't work.

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.
Vlad C. (Guest)
on 2009-04-30 12:02
Hi all,

I'm making this post, because I JUST downloaded a ruby executable from
ruby website. Then ran the command "gem install rails" to install rails.

All was good and done, up until this point. Now I wanted to make sure -
that everything was in place. So I went to C: and ran the commands to
make sure everything was working:

rails hello

cd hello

ruby script/generate controller Hello index

ruby script/server

_____________________________________________

Now what I should see is atleast a page - alerting me to where to edit
the controller/view. But Nope. What I see is...

________________________________________________
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it
shortly.
___________________________________________________________________________

This is frustrating because up until now, it should all work, so I can
begin development of an app. But no matter how many controllers I
generate, and try to see a simple page to let me know everythings fine:
Only that error comes with its standard red font. I have no firewalls or
anything - but this is the most basic of all and I seem to not be able
to even make it from here. There are no firewalls running and I tried
port 80 to no avail.

I was hoping, that maybe one of you folks would have some idea. Because
I have failed at the troubleshooting that I tried.

Below is the log of a simple request to a controller, so that you can
narrow it down.

Thanks in advance.....
___________________________________________________________________

/!\ FAILSAFE /!\  Thu Apr 30 00:42:34 -0700 2009
  Status: 500 Internal Server Error
  no such file to load -- sqlite3
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
`require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in
`new_constants_in'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
`require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in
`sqlite3_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
    C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
`connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in
`cache'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:93:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`synchronize'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:46:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in
`each'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/content_length.rb:13:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:46:in
`service'
    C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:13:in
`run'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    script/server:3
Frederick C. (Guest)
on 2009-04-30 12:13
(Received via mailing list)
On Apr 30, 9:02 am, Vlad C. <removed_email_address@domain.invalid>
wrote:
_________________________________________________________________________
>
> This is frustrating because up until now, it should all work, so I can
> begin development of an app. But no matter how many controllers I
> generate, and try to see a simple page to let me know everythings fine:
> Only that error comes with its standard red font. I have no firewalls or
> anything - but this is the most basic of all and I seem to not be able
> to even make it from here. There are no firewalls running and I tried
> port 80 to no avail.

By default rails uses sqlite3 as its database and you are missing
either (or both of):
- the sqlite3 library itself
- the ruby bindings for sqlite3 (gem install --version=1.2.3 sqlite3-
ruby )

Fred
Rohan D. (Guest)
on 2009-04-30 14:33
(Received via mailing list)
Sqllite3 is not installed
To install  Sqllite3 database follow what is given here
    http://blog.emson.co.uk/2008/06/installing-sqlite3...

Install sqllite3 gem using this command
    gem install sqlite3-ruby-1.2.1-mswin32.gem

Hope this helps.

Rohan
7stud -. (Guest)
on 2009-04-30 15:48
Vlad C. wrote:
> Hi all,
>
> I'm making this post, because I JUST downloaded a ruby executable from
> ruby website. Then ran the command "gem install rails" to install rails.
>

The reason they know you don't have sqlite3 installed, which is what the
current version of rails uses by default, is from this message at the
top of the trace:

> Thanks in advance.....
> ___________________________________________________________________
>
> /!\ FAILSAFE /!\  Thu Apr 30 00:42:34 -0700 2009
>   Status: 500 Internal Server Error
>   no such file to load -- sqlite3   <-----*********

You can use another database if you want, like mysql, but then you need
to edit the file config/database.yml and change it to something like
this:


development:
  adapter: mysql
  encoding: utf8
  database: hello_development
  username: root
  password:
  host: localhost

No matter what database you have installed or will install, you also
have to install a gem that allows ruby to talk to your database.

By the way, my book, AWDWR(3rd), which was just published says windows
users should install InstantRails.

1) Create a folder with no spaces in the name for the installation
directory.

2) Go to the instant rails website and download the latest .zip file and
put it in your folder created in step 1.

3) Unzip the file if your system didn't do it automatically.

4) Navigate to InstantRails-2.0 directory and double click the
InstantRails icon.

--click OK if there is a popup that asks to regenerate configuration
files
--firewall: safest course is to choose Keep Blocking

5) A small instant rails window should appear.  Click the I button in
top left corner.  From the menu select Rails Application, then Open Ruby
Console Window.

6) A command window should pop up pointing to the rails_apps directory.
--type the command ruby -v and hit enter
--type the command rails -v and hit enter

7) Always use an InstantRails window to enter commands in -- NOT a
regular Windows command window.

8) Update rubygems and rails:

C:\rails_apps> gem update --system
C:\rails_apps> gem update rails
This topic is locked and can not be replied to.