Koozali.org: home of the SME Server

Rails 123 & Gems

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #15 on: October 23, 2007, 02:26:12 PM »
I sometimes get things to work after blundering about for awhile, so don't count on me to work this one out, please.

Don't know if this may help:
The Openfire contrib has a pointer to a script installed in /opt/openfire/bin/extra during the Openfire server install. The script will create a daemon for itself that will restart the IRC server on reboot...
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #16 on: October 23, 2007, 02:37:06 PM »
I sometimes get things to work after blundering about for awhile, so don't count on me to work this one out, please.

Don't know if this may help:
The Openfire contrib has a pointer to a script installed in /opt/openfire/bin/extra during the Openfire server install. The script will create a daemon for itself that will restart the IRC server on reboot...

I wish it was that easy

My understanding of it, is to create a template fragment similar to Metadot V6, will let you know when I got it worked out

Russell
« Last Edit: October 23, 2007, 02:38:56 PM by fixit »
.........

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #17 on: October 23, 2007, 06:09:31 PM »
updated beta, no need to create the database manually

http://www.fixitcomputers.com.au/downloads/metadot_7/sme-metadot.7.1.0.tar.gz

mkdir /opt/metdot7

cd /opt/metdot7

wget http://www.fixitcomputers.com.au/downloads/metadot_7/sme-metadot.7.1.0.tar.gz

tar xvzf sme-metadot.7.1.0.tar.gz

chown -R www.www /opt/metadot7

chmod 750 /opt/metadot7

chmod 755 install


you can create your own or use the example below

./install --no-tests metadot metadotuser metadotpass

cd /opt/metadot7/metadot-rails

ruby script/server

go to http://servername-or-192.168.1.1:3000/

Initial login:

email: admin@yoursite.com

password: admin123

Russell

russell@fixitcomputers.com.au


« Last Edit: October 23, 2007, 06:48:03 PM by fixit »
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #18 on: October 24, 2007, 01:27:42 PM »
Quote
updated beta, no need to create the database manually
I presume I don't have to delete my db, just because I created manually?

I'm just needing a permanent start-up script
SME Server is a fantastic product - thank you!

Offline Tib

  • *
  • 571
  • +0/-0
    • http://www.tibors.net
Re: Rails 123 & Gems
« Reply #19 on: October 25, 2007, 05:53:39 AM »

I have a small question, please:

How can I turn the following command into a start-up service, so it becomes permanent through reboots, etc:
# ruby script/server




For now why don't you put them into your /etc/rc.d/rc.local file every time it boots up, it will run this for you

As quoted for the file ...
Quote
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

Regards,

Tib

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #20 on: October 25, 2007, 12:53:44 PM »
New

# ruby /opt/metadot7/metadot-rails/script/server returns error:
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
!!! Path to log file not valid: log/mongrel.log
mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get help.
Exiting

Looks like Ruby was updated during the last lot of security fixes (not sure about gems) - darn, sorry guys, I didn't look at each package in the list, just went ahead.
# rails -v
Rails 1.2.5
The howto is for Rails 1.2.3 - Russell, should I re-run gems against this or re-install rubygems-0.9.4.tgz as per your original howto?

SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #21 on: October 25, 2007, 02:09:29 PM »
That error would occur if you have more than one Mongrel app running in the background

did you follow Tibs post on how start the service on startup, if so, might be a good idea to remove it

to check and see if your rails application is still running, go to your browser and open http://servername-or-ip:3000

Russell

.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #22 on: October 25, 2007, 02:49:36 PM »
I had tried Tibs idea, but the server didn't start - wasn't sure of what actually to put into the rc.local file. I tried an absolute pathname. I don't think that's correct.
Before I removed that, I tried a cli start - gave above error.

Now I followed your input, removed the entry from rc.local and restarted
Same error
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #23 on: October 25, 2007, 03:11:07 PM »
what happened when you started your browser with  http://servername-or-192.168.1.1:3000/ , did metadot load


Russell
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #24 on: October 25, 2007, 03:29:29 PM »
No and
Quote
netstat -ant | grep 3000
returns nothing.
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #25 on: October 25, 2007, 03:41:22 PM »
cd /opt/metadot7/metadot-rails

then run

rake

do you get any error messages

if none, try using this command to start metadot

ruby script/server -e production

if you get same errors

try

gem install cgi_multipart_eof_fix

Russell
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #26 on: October 25, 2007, 04:11:01 PM »
Quote
do you get any error messages
# rake
(in /opt/metadot7/metadot-rails)
rake aborted!
undefined method `[]' for false:FalseClass
/opt/metadot7/metadot-rails/Rakefile:14
(See full trace by running task with --trace)

then I did:
Quote
gem install cgi_multipart_eof_fix
]# gem install cgi_multipart_eof_fix
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed cgi_multipart_eof_fix-2.3
Installing ri documentation for cgi_multipart_eof_fix-2.3...
Installing RDoc documentation for cgi_multipart_eof_fix-2.3...
No error here

Then rake:
# rake
(in /opt/metadot7/metadot-rails)
rake aborted!
undefined method `[]' for false:FalseClass
/opt/metadot7/metadot-rails/Rakefile:14
(See full trace by running task with --trace)

which is as above (in this message)

then i tried
metadot-rails# ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:201:in `establish_connection': undefined method `[]' for false:FalseClass (NoMethodError)
        from ./script/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:229:in `initialize_database'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:88:in `process'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:43:in `send'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:43:in `run'
        from /opt/metadot7/metadot-rails/config/environment.rb:37
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
         ... 27 levels...
        from ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'
        from ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'
        from script/server:5
SME Server is a fantastic product - thank you!

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #27 on: October 25, 2007, 04:59:26 PM »
Sorry for all the issues, Russell, and thanks for the help so far, but I see this as a good way to iron out bugs in the howto, not so?

I need to go out now. It's 17h00 local time here in Cape Town.
I'll continue 08h00 my time tomorrow when I'm back in my cubbyhole.
SME Server is a fantastic product - thank you!

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #28 on: October 28, 2007, 03:33:31 PM »
I need to revive this in order to reach a conclusion, if I may?
Quote
do you get any error messages
yes - see previous message
and
Quote
if you get same errors
try...
same errors - see previous message
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #29 on: October 28, 2007, 05:03:13 PM »
I do believe it could be due an incompatible ruby verssion, I have been looking for ruby 1.8.6 to go on sme

This is all I could find so far, I have not tested these yet

http://www.clyde-family.org/rhel4/i386/

Russell
.........