My first prject won't work

Beginner Ruby on Rails quesition

Page 1 of 1

6 Replies - 1396 Views - Last Post: 27 July 2010 - 10:34 AM Rate Topic: -----

#1 tastysoup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-August 09

My first prject won't work

Posted 26 July 2010 - 03:10 PM

Hi all,

I am trying to learn Ruby and Rails from a couple of books and some online tutorials. I am having trouble getting my test project to work.

I have gotten the localhost to connect at http://localhost:3000/ and I get the hold page that is there. but when I go to http://localhost:3000/sals/hello which should load my helloworld program, I get the message:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.



I have put this code under the filename hello.rhtml in the /views/sals directory.

 <html>
 <body>
  <h1><%= @message %></h1>
 </body>
</html>



I also put this in for the sals_controller.rb file.

class SalsController < ApplicationController
def hello
 @message = 'Hello World!'
 end
end



I am sort of stuck. I am running on Ubuntu. Does anyone have any idea what I am doing wrong?

Thanks,

Is This A Good Question/Topic? 0
  • +

Replies To: My first prject won't work

#2 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: My first prject won't work

Posted 26 July 2010 - 03:14 PM

What version of rails?

Can you post the actual error message (from logs/development.log)?

Do you have any routes defined?

What happens if you change the file to hello.html.erb?
Was This Post Helpful? 0
  • +
  • -

#3 tastysoup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-August 09

Re: My first prject won't work

Posted 26 July 2010 - 03:25 PM

Hi again,

Thanks for the reply. I downloaded rubygems1.3.5.

Here is the error

/!\ FAILSAFE /!\  Mon Jul 26 15:22:59 -0700 2010
  Status: 500 Internal Server Error
  no such file to load -- sqlite3
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/requires.rb:7:in `require_library_or_gem'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in `cache'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in `call'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/head.rb:9:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in `call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/reloader.rb:34:in `run'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in `call'
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/rack/static.rb:31:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `each'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `call'
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/rack/log_tailer.rb:17:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run'
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:111
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    ./script/server:3



thanks again!








View PostThe Neoracle, on 26 July 2010 - 02:14 PM, said:

What version of rails?

Can you post the actual error message (from logs/development.log)?

Do you have any routes defined?

What happens if you change the file to hello.html.erb?

Was This Post Helpful? 0
  • +
  • -

#4 MitkOK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 32
  • View blog
  • Posts: 403
  • Joined: 09-August 07

Re: My first prject won't work

Posted 26 July 2010 - 04:33 PM

Quote

no such file to load -- sqlite3

You should install sqlite3 gem -
sudo gem install sqlite3-ruby

Before that, maybe you should install development files for sqlite3. In Ubuntu -
sudo apt-get install libsqlite3-dev


And one more thing - where did you get rubygems 1.3.5, when on http://rubygems.org there is 1.3.7. To update rubygems type
sudo gem update --system

This post has been edited by MitkOK: 26 July 2010 - 04:34 PM

Was This Post Helpful? 0
  • +
  • -

#5 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: My first prject won't work

Posted 26 July 2010 - 04:44 PM

Yes, you'll need to install sqlite3.

You'll also need to install the sqlite gem as MitkOK said.

Then you need to create your database:

rake db:create


Was This Post Helpful? 0
  • +
  • -

#6 tastysoup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-August 09

Re: My first prject won't work

Posted 26 July 2010 - 06:10 PM

Thank you everyone, I seem to have missed a few steps. I will try all of this and post back my results.

Thanks again!
Was This Post Helpful? 0
  • +
  • -

#7 tastysoup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-August 09

Re: My first prject won't work

Posted 27 July 2010 - 10:34 AM

Hi again

It is all working now! Thanks!

I had several problems including having installed gems in the totally wrong directory, this causing weird permission issues that I don't quite understand. It is all the right versions in the right places now so I am good to continue.

Thanks again!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1