kernel panic in userspace

my own self destruction
  • Blog
  • about
  • articles
    • Virtualbox bridge
    • linux blogging
    • Gentoo on Acer Extensa 5630Z
  • code
    • @unfollowr
    • WordPress
      • WordPress-bbPress syncronization
      • IE Warning
      • PostAds
    • Callisto overlay
    • @listwatcher
  • CV
  • belarusian
  • russian
  • english

ruby-on-rails installation on gentoo

Aug 01 2008
KoЯn – Bitch We Got a Problem
  • belarusian
  • russian

GCC 4.3.1 не перестаёт меня удивлять на пару с установкой ruby on rails. Пару лет назад оно тоже не с полпинка ставилось, теперь тоже :-)
Посему я сделал небольшой фикс, для сборки rails с поддержкой fastcgi и mysql придётся сделать следующие шаги:

cd /usr/portage/distfiles
rm mysql-ruby-2.7.5.tar.gz ruby-fcgi-0.8.7.tar.gz
wget http://bobrik.name/uploads/mysql-ruby-2.7.5.tar.gz
wget http://bobrik.name/uploads/ruby-fcgi-0.8.7.tar.gz
ebuild /usr/portage/dev-ruby/ruby-fcgi/ruby-fcgi-0.8.7.ebuild digest
ebuild /usr/portage/dev-ruby/mysql-ruby/mysql-ruby-2.7.5.ebuild digest

Теперь можно собрать сами rails и начать использование, чем я и займусь в процессе чтения “Agile Web Development with Rails: Second Edition”. Кому нужна книжка в djvu (“Гибкая разработка веб-приложений в среде Rails”) – прошу в комменты.
В полной версии поста листинги ошибок и инфа по теме.

Для fcgi модуля выдаёт примерно следующие ошибки:
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
*** /var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi/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
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi
--curdir
--ruby=/usr/bin/ruby19
--with-fcgi-dir
--without-fcgi-dir
--with-fcgi-include
--without-fcgi-include=${fcgi-dir}/include
--with-fcgi-lib
--without-fcgi-lib=${fcgi-dir}/lib
install.rb:656:in `command': system("/usr/bin/ruby19" "/var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi/extconf.rb") failed (RuntimeError)
from install.rb:661:in `ruby'
from install.rb:1237:in `extconf'
from install.rb:1233:in `config_dir_ext'
from install.rb:1498:in `block in traverse'
from install.rb:1515:in `dive_into'
from install.rb:1496:in `traverse'
from install.rb:1500:in `block (2 levels) in traverse'
from install.rb:1499:in `each'
from install.rb:1499:in `block in traverse'
from install.rb:1515:in `dive_into'
from install.rb:1496:in `traverse'
from install.rb:1490:in `block in exec_task_traverse'
from install.rb:1485:in `each'
from install.rb:1485:in `exec_task_traverse'
from install.rb:1220:in `exec_config'
from install.rb:991:in `exec_config'
from install.rb:827:in `invoke'
from install.rb:774:in `invoke'
from install.rb:1544:in `<main>'

Для mysql модуля примерно следующие:
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
creating Makefile
i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.0/i686-linux -I/usr/include/ruby-1.9.0 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_MYSQL_H -I/usr/local/include -D_FILE_OFFSET_BITS=64 -fPIC -march=pentium4 -O2 -pipe -mfpmath=sse -mmmx -msse -msse2 -mtune=native -ftracer -fstack-protector -fno-strict-aliasing -O2 -g -Wall -Wno-parentheses -fPIC -o mysql.o -c mysql.c
mysql.c:6:21: error: version.h: No such file or directory
mysql.c: In function 'escape_string':
mysql.c:280: error: 'struct RString' has no member named 'len'
mysql.c:281: error: 'struct RString' has no member named 'len'
mysql.c:281: error: 'struct RString' has no member named 'ptr'
mysql.c:281: error: 'struct RString' has no member named 'ptr'
mysql.c:281: error: 'struct RString' has no member named 'len'
mysql.c: In function 'real_escape_string':
mysql.c:414: error: 'struct RString' has no member named 'len'
mysql.c:415: error: 'struct RString' has no member named 'len'
mysql.c:415: error: 'struct RString' has no member named 'ptr'
mysql.c:415: error: 'struct RString' has no member named 'ptr'
mysql.c:415: error: 'struct RString' has no member named 'len'
mysql.c: In function 'query':
mysql.c:725: error: 'struct RString' has no member named 'ptr'
mysql.c:725: error: 'struct RString' has no member named 'len'
mysql.c:745: error: 'struct RString' has no member named 'ptr'
mysql.c:745: error: 'struct RString' has no member named 'len'
mysql.c: In function 'query_with_result_set':
mysql.c:898: warning: implicit declaration of function 'TypeError'
mysql.c: In function 'fetch_field_direct':
mysql.c:976: warning: implicit declaration of function 'Raise'
mysql.c: In function 'fetch_hash2':
mysql.c:1048: error: 'struct RString' has no member named 'ptr'
mysql.c:1049: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'field_inspect':
mysql.c:1173: error: 'struct RString' has no member named 'len'
mysql.c:1174: error: 'struct RString' has no member named 'ptr'
mysql.c:1174: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'stmt_bind_result':
mysql.c:1299: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'stmt_prepare':
mysql.c:1622: error: 'struct RString' has no member named 'ptr'
mysql.c:1622: error: 'struct RString' has no member named 'len'
make: *** [mysql.o] Error 1

Но это всё для поисковых машин скорее, вдруг кто сам не найдёт решения :-)
А решение вовсе и не трудное, стоит лишь в проблемных файлах заменить RSTRING(str)->ptr и RSTRING(str)->len на RSTRING_PTR(str) и RSTRING_LEN(str) соответственно

  • belarusian
  • russian

GCC 4.3.1 не спыняе спробы зьдзівіць мяне на пару з усталёўкай ruby on rails. Пару гадоў таму яно таксама ня з паўпінка заводзілася, тяпер таксама :-)
Таму я зрабіў невялічкі фікс, для зборкі rails з падтрымкай fastcgi і mysql прыйдзецца зрабіць наступныя крокі:

cd /usr/portage/distfiles
rm mysql-ruby-2.7.5.tar.gz ruby-fcgi-0.8.7.tar.gz
wget http://bobrik.name/uploads/mysql-ruby-2.7.5.tar.gz
wget http://bobrik.name/uploads/ruby-fcgi-0.8.7.tar.gz
ebuild /usr/portage/dev-ruby/ruby-fcgi/ruby-fcgi-0.8.7.ebuild digest
ebuild /usr/portage/dev-ruby/mysql-ruby/mysql-ruby-2.7.5.ebuild digest

Цяпер магчыма сабраць самі rails і пачаць выкарыстаньне, чым я і займуся ў працэсе чытаньня “Agile Web Development with Rails: Second Edition”. Каму патрэбна кніжка ў djvu на расейскай (“Гибкая разработка веб-приложений в среде Rails”) – прашу ў каменты. У поўнай вэрсіі паста лістынгі памылак і інфа па тэме.

Для fcgi модуля выдае прыкладна наступныя памылкі:
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
*** /var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi/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
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi
--curdir
--ruby=/usr/bin/ruby19
--with-fcgi-dir
--without-fcgi-dir
--with-fcgi-include
--without-fcgi-include=${fcgi-dir}/include
--with-fcgi-lib
--without-fcgi-lib=${fcgi-dir}/lib
install.rb:656:in `command': system("/usr/bin/ruby19" "/var/tmp/portage/dev-ruby/ruby-fcgi-0.8.7/work/ruby-fcgi-0.8.7/ext/fcgi/extconf.rb") failed (RuntimeError)
from install.rb:661:in `ruby'
from install.rb:1237:in `extconf'
from install.rb:1233:in `config_dir_ext'
from install.rb:1498:in `block in traverse'
from install.rb:1515:in `dive_into'
from install.rb:1496:in `traverse'
from install.rb:1500:in `block (2 levels) in traverse'
from install.rb:1499:in `each'
from install.rb:1499:in `block in traverse'
from install.rb:1515:in `dive_into'
from install.rb:1496:in `traverse'
from install.rb:1490:in `block in exec_task_traverse'
from install.rb:1485:in `each'
from install.rb:1485:in `exec_task_traverse'
from install.rb:1220:in `exec_config'
from install.rb:991:in `exec_config'
from install.rb:827:in `invoke'
from install.rb:774:in `invoke'
from install.rb:1544:in `<main>'

Для mysql модуля прыкладна наступныя:
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
creating Makefile
i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.0/i686-linux -I/usr/include/ruby-1.9.0 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_MYSQL_H -I/usr/local/include -D_FILE_OFFSET_BITS=64 -fPIC -march=pentium4 -O2 -pipe -mfpmath=sse -mmmx -msse -msse2 -mtune=native -ftracer -fstack-protector -fno-strict-aliasing -O2 -g -Wall -Wno-parentheses -fPIC -o mysql.o -c mysql.c
mysql.c:6:21: error: version.h: No such file or directory
mysql.c: In function 'escape_string':
mysql.c:280: error: 'struct RString' has no member named 'len'
mysql.c:281: error: 'struct RString' has no member named 'len'
mysql.c:281: error: 'struct RString' has no member named 'ptr'
mysql.c:281: error: 'struct RString' has no member named 'ptr'
mysql.c:281: error: 'struct RString' has no member named 'len'
mysql.c: In function 'real_escape_string':
mysql.c:414: error: 'struct RString' has no member named 'len'
mysql.c:415: error: 'struct RString' has no member named 'len'
mysql.c:415: error: 'struct RString' has no member named 'ptr'
mysql.c:415: error: 'struct RString' has no member named 'ptr'
mysql.c:415: error: 'struct RString' has no member named 'len'
mysql.c: In function 'query':
mysql.c:725: error: 'struct RString' has no member named 'ptr'
mysql.c:725: error: 'struct RString' has no member named 'len'
mysql.c:745: error: 'struct RString' has no member named 'ptr'
mysql.c:745: error: 'struct RString' has no member named 'len'
mysql.c: In function 'query_with_result_set':
mysql.c:898: warning: implicit declaration of function 'TypeError'
mysql.c: In function 'fetch_field_direct':
mysql.c:976: warning: implicit declaration of function 'Raise'
mysql.c: In function 'fetch_hash2':
mysql.c:1048: error: 'struct RString' has no member named 'ptr'
mysql.c:1049: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'field_inspect':
mysql.c:1173: error: 'struct RString' has no member named 'len'
mysql.c:1174: error: 'struct RString' has no member named 'ptr'
mysql.c:1174: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'stmt_bind_result':
mysql.c:1299: error: 'struct RString' has no member named 'ptr'
mysql.c: In function 'stmt_prepare':
mysql.c:1622: error: 'struct RString' has no member named 'ptr'
mysql.c:1622: error: 'struct RString' has no member named 'len'
make: *** [mysql.o] Error 1

Але ўсё гэта збольшага для пашуковых машын хутчэй, можа хто ня знойдзе сам рашэньня :-)
А выйсьце зусім і ня цяжкае, трэба толькі ў праблемных файлах замяніць RSTRING(str)->ptr і RSTRING(str)->len на RSTRING_PTR(str) і RSTRING_LEN(str) спалучальна

« so lucky voodoo troll »

Tags
books, bugs, fastcgi, fix, gcc, gentoo, howto, mysql, mysql-ruby, rails, ruby, ruby-fcgi, strings
Categories
Belarusian, Russian
Meta
Subscribe [ru] Subscribe [be] Comments rss Trackback
Similar
ruby overlay and building | Gentoo virtualbox | wordpress performance fail | gentoo midori (webkit) testing | nano color highlight howto

6 responses to “ruby-on-rails installation on gentoo”

Aug 01 2008
bobrik (00:47:31) :

Ну вот песня в тему идёт так :D

Aug 01 2008
Виктор (03:52:19) :

Хочу книжку! Хочу книжку! Как получить?)

Aug 01 2008
bobrik (08:48:04) :

Отправь смс на номер… xD На e-mail вышлю тебе

Aug 01 2008
Stalwart (15:00:29) :

Я бы от книжки не отказался

Aug 01 2008
Виктор (17:42:42) :

Stalwart, а всё!!! Он уже мне её выслал!! Теперь жди, когда я прочитаю!!

Бебебе! :-P

Aug 01 2008
bobrik (19:30:38) :

Миниатюра “Как DRM изменит вашу жизнь к лучшему” :-)))))

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


RSS antisocial feeling

  • so much i
  • i am freaking bicycle
  • с третьей минуты мне очень. детство
  • не спрашивайте
  • banksystreetart: Banksy / Simon Munnery fuck yeah shit

Tags

bash belarus blog blogs bugs coding concerts download friends fun gentoo google images internet javascript kde language life links linux livejournal me money music overlays perl photos php plugins portage projects rss school shell social social networks ssh studying tests twitter ubuntu univer vkontakte wifi wordpress

links

  • asocial feeling
  • Callisto overlay
  • daThumbs
  • last.fm
  • twitter
  • Vkontakte
  • ~idioteque

Recent Comments

  • saper on antialiased fonts in netbeans (java apps in common)
  • edward on IE Warning
  • Vigoran on WordPress-bbPress syncronization
  • Nikos on WordPress-bbPress syncronization
  • Maxno on free licenses
  • achmad on IE Warning
  • bobrik on bbPress terms filtering & hacks
  • Сергей М. on bbPress terms filtering & hacks
  • Samad Khan on WordPress-bbPress syncronization
  • bobrik on WordPress-bbPress syncronization

Archives

  • July 2010 (1)
  • June 2010 (1)
  • April 2010 (2)
  • January 2010 (1)
  • November 2009 (2)
  • October 2009 (5)
  • September 2009 (2)
  • August 2009 (2)
  • July 2009 (3)
  • June 2009 (1)
  • April 2009 (2)
  • March 2009 (1)
  • February 2009 (1)
  • January 2009 (2)
  • December 2008 (12)
  • November 2008 (17)
  • October 2008 (20)
  • September 2008 (13)
  • August 2008 (25)
  • July 2008 (18)
  • June 2008 (15)
  • May 2008 (7)
  • March 2008 (1)
  • February 2008 (9)
  • January 2008 (11)
  • December 2007 (24)
  • November 2007 (27)
  • October 2007 (21)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Creative Commons License rss comments rss valid xhtml