Koozali.org: home of the SME Server

Rails 123 & Gems

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Rails 123 & Gems
« on: September 11, 2007, 10:46:48 PM »
Hi all
I have a hiccup on upgrading SME Server 7.2's Ruby to Ver 1.8.5 as required by the Metadot 7 beta install (on the Howto Page). I can't create an a/c on the howto for some reason (repeatedly gives only a login dialog), so I am "forced" to ask here ;-)

If anyone has followed the steps (I know it's beta) could you perhaps explain why I get as far as:
# rails -v
Rails 1.2.3

but, when I do:
# gem install mongrel --include-dependencies
Select which gem to install for your platform (i386-linux)
 1. mongrel 1.0.1 (mswin32)
 2. mongrel 1.0.1 (ruby)
 3. mongrel 1.0 (mswin32)
 4. mongrel 1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
> 2
Select which gem to install for your platform (i386-linux)
 1. fastthread 1.0 (ruby)
 2. fastthread 1.0 (mswin32)
 3. fastthread 0.6.4.1 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. Skip this gem
 6. Cancel installation
> 1
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install mongrel --include-dependencies
can't find header files for ruby.

How is this possible if I get as far as this?
Any pointers welcome (Russell, if you read this you may feel inclined to respond?)

Thanks in advance,
Regards.
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #1 on: September 12, 2007, 01:56:00 AM »
The reason why it wont install is because the gcc was not installed try running these command

yum install gcc-c++ libxml2-devel bzip2-devel curl-devel

then run

gem install mongrel --include-dependencies

Russell



.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #2 on: September 12, 2007, 02:34:20 PM »
Russell, I did as you suggested:
Quote
yum install gcc-c++ libxml2-devel bzip2-devel curl-devel
and that software was installed.

Then I ran:
Quote
gem install mongrel --include-dependencies
and that gave:
[root@ps rubygems-0.9.4]# gem install mongrel --include-dependencies
Need to update 0 gems from http://gems.rubyforge.org

complete
Select which gem to install for your platform (i386-linux)
 1. mongrel 1.0.1 (mswin32)
 2. mongrel 1.0.1 (ruby)
 3. mongrel 1.0 (mswin32)
 4. mongrel 1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
> 2
Select which gem to install for your platform (i386-linux)
 1. fastthread 1.0 (ruby)
 2. fastthread 1.0 (mswin32)
 3. fastthread 0.6.4.1 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. Skip this gem
 6. Cancel installation
> 1
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install mongrel --include-dependencies
can't find header files for ruby.

This is basically the same error except this time there was no need to update any gems.

SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #3 on: September 12, 2007, 03:30:22 PM »
Try uninstalling the gems with these commands and do the install again

to uninstall

gem uninstall -a mongrel

then press y

also remove fastthread

gem uninstall fastthread

Russell

.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #4 on: September 12, 2007, 04:55:12 PM »
Cant find gems:
Quote
gem uninstall -a mongrel
and
Quote
gem uninstall fastthread

# gem uninstall -a mongrel
ERROR:  While executing gem ... (Gem::InstallError)
    Unknown gem mongrel-> 0
# gem uninstall fastthread
ERROR:  While executing gem ... (Gem::InstallError)
    Unknown gem fastthread-> 0

So perhaps nothing was built?
Being somewhat of a noob, not sure where else to look...
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #5 on: September 13, 2007, 11:44:00 AM »
 Things to try

if you get this error message, then, it already has been uninstalled or wasn't installed at all

# gem uninstall -a mongrel
ERROR:  While executing gem ... (Gem::InstallError)
    Unknown gem mongrel-> 0


gem uninstall fastthread

gem uninstall -a mongrel

gem uninstall rake

gem uninstall -a rails

yum remove ruby*.*

Follow the install procedures again
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #6 on: October 19, 2007, 04:20:30 PM »
Hi Russell
Much time has passed. I'm again trying to update Ruby and Gems (on a re-install with all updates). I'm following your howto at Contribs.org.

This time I'm almost there, suddenly this:
# ruby setup.rb config
entering config phase...
config done.
# ruby setup.rb setup
entering setup phase...
setting #! line to "#!/usr/bin/ruby"
setting #! line to "#!/usr/bin/ruby"
/usr/bin/ruby extconf.rb
checking for sqlite_open() in -lsqlite... no
*** 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
       
        <snipped>
     
        --without-sqlitelib
setup failed
'system /usr/bin/ruby extconf.rb' failed
try "ruby setup.rb --help" for usage

All previous set-ups to this point completed satisfactorily with no errors.
Then I deleted the ruby-dbi dir, re-downloaded the dbi-0.1.1.tar.gz file, extracted, etc. Same result.

Tantalizingly close. Can you help?
TIA



SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #7 on: October 20, 2007, 01:18:22 PM »
try skipping the dbi-0.1.1.tar.gz installation step and follow the rest of the instructions

Russell
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #8 on: October 20, 2007, 03:08:29 PM »
Hi, Russell
Quote
try skipping the dbi-0.1.1.tar.gz installation step and follow the rest of the instructions

Apologies for lengthy post.
Did as suggested. Installing metadot password aborted:

# ./install --no-tests mwiki xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ install --mode=700 --directory metadot-on-rails-attachments
+ cd metadot-on-rails-attachments
+ tar -xf ../default_wiki_attachments.tar
+ cd ..
+ install --mode=700 --directory metadot-rails
+ cd metadot-rails
+ tar -xf ../wiki.tar
+ install --mode=700 --directory log
+ sed 's/metadot_/mwiki_/g; s/password:/password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ./config/database-sample.yml
sed: -e expression #1, char 77: unknown option to `s'
+ set +x

***************
*** ABORTED ***
***************

I used correct password (copy paste) from .mycnf
3 new db's were created: mwiki_development, mwiki_production and mwiki_test - all 0 tables.

Noticed this line from above
Quote
+ sed 's/metadot_/mwiki_/g; s/password:/password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I removed :password from line 90 of install (forgive presumptuousness)

re-running ./install still aborts, but at this point:
]# ./install --no-tests mwiki xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ install --mode=700 --directory metadot-on-rails-attachments
+ cd metadot-on-rails-attachments
+ tar -xf ../default_wiki_attachments.tar
+ cd ..
+ install --mode=700 --directory metadot-rails
+ cd metadot-rails
+ tar -xf ../wiki.tar
+ install --mode=700 --directory log
+ sed 's/metadot_/mwiki_/g; s/password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ./config/database-sample.yml
+ '[' 2 -gt 1 ']'
+ rake install database=mwiki username=root password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(in /opt/metadot7/metadot-rails)
+ rake db:migrate
(in /opt/metadot7/metadot-rails)
rake aborted!
Access denied for user 'root'@'localhost' (using password: NO)

(See full trace by running task with --trace)
+ set +x

***************
*** ABORTED ***
***************

This line from above is interesting
Quote
Access denied for user 'root'@'localhost' (using password: NO)
could that be because of removing (what appeared to me) to be a duplicate "password:" in install?

I don't really know what I'm doing, except I was trying to "trouble shoot"  - please forgive if I'm barking up the wrong tree - feel somewhat foolish  :-?

See if you can assist, please.

« Last Edit: October 20, 2007, 03:57:59 PM by ardugh »
SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #9 on: October 20, 2007, 03:37:06 PM »
There was no need to edit the install script and I would advise masking the mysql password in your post

try chown -R www.www and also chmod 750 the directory where metadot is installed, maybe also check the file permissions on the install script, try changing them to 755

Russell
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #10 on: October 20, 2007, 04:09:52 PM »
Quote
...and I would advise masking the mysql password in your post
Thanks for the password reminder. I sorted that.

Quote
There was no need to edit the install script ; try chown -R www.www and also chmod 750 the directory where metadot is installed, maybe also check the file permissions on the install script, try changing them to 755

<snip>
+ sed 's/metadot_/mwiki_/g; s/password:/password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
./config/database-sample.yml
sed: -e expression #1, char 77: unknown option to `s'
+ set +x

***************
*** ABORTED ***
***************
</snip>

I put back line 90 of install script as it was.
Response is same as originally reported.
What do you think this line from above indicates?
Quote
sed: -e expression #1, char 77: unknown option to `s'

SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #11 on: October 20, 2007, 05:37:30 PM »
OK, try this, this is my modified version, just been tested a my test server

Download sme-metadot7.0.7.tar.gz http://www.fixitcomputers.com.au/downloads/metadot_7/sme-metadot7.0.7.tar.gz


cd /opt/metadot

tar xzvf sme-metadot7.0.7.tar.gz


Create these databases

mysqladmin create mwiki_development

mysql -e "grant all privileges on mwiki_development.* to mwikiuser@localhost identified by 'mwikipass'"


mysqladmin create mwiki_production

mysql -e "grant all privileges on mwiki_production.* to mwikiuser@localhost identified by 'mwikipass'"



mysqladmin create mwiki_test

mysql -e "grant all privileges on mwiki_test.* to mwikiuser@localhost identified by 'mwikipass'"


mysqladmin create mwiki

mysql -e "grant all privileges on mwiki.* to mwikiuser@localhost identified by 'mwikipass'"

cd /opt/metadot

./install --no-tests mwiki mwikiuser mwikipass


cd /opt/metadot/metadot-rails

ruby script/server

http://servername-or-ip:3000/

let me know how you go

Russell
.........

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #12 on: October 20, 2007, 05:58:11 PM »
Quote
let me know how you go

 :-D Install completes. Very cool - the new metadot will be a hit - one thing:

When I kill the ssh shell where
Quote
ruby script/server
is running, the site goes down.
SME Server is a fantastic product - thank you!

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Rails 123 & Gems
« Reply #13 on: October 22, 2007, 11:12:05 PM »
Hi all.

First off, thanks to all those who help others like me get ahead with SME Server and relevant add-ons.
In particular, thanks Russell for helping with this thread re Metadot 7.
Sme Server is a great product that deserves far more acclaim than it receives.
I going to give my 2c worth by linking to http://www.smeserver.org/ on my personal website and at least one other I'm developing for a senior school.
Both are running 7.2

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


SME Server is a fantastic product - thank you!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
Re: Rails 123 & Gems
« Reply #14 on: October 23, 2007, 02:30:22 AM »
I am still working on that area, hopefully will have something soon, but if you would like to try it out for yourself, here are some links that might be of interest

http://wiki.rubyonrails.org/rails/pages/GettingStartedWithRails
http://wiki.rubyonrails.org/rails/pages/HowToSetTheBaseURLsOfYourRailsApps

Russell
.........