{"id":1316,"date":"2011-04-06T23:39:38","date_gmt":"2011-04-06T15:39:38","guid":{"rendered":"https:\/\/www.dremi.info\/?p=1316"},"modified":"2011-04-06T23:39:38","modified_gmt":"2011-04-06T15:39:38","slug":"fix-installing-ruby-on-rails-3-mysql-and-solve-few-problem-on-ubuntu-1010-maverick","status":"publish","type":"post","link":"https:\/\/www.dremi.info\/articles\/fix-installing-ruby-on-rails-3-mysql-and-solve-few-problem-on-ubuntu-1010-maverick.html","title":{"rendered":"[FIX] Installing Ruby on Rails 3, MySQL and SOLVE few problem on UBUNTU 10.10 (Maverick)"},"content":{"rendered":"

This is my experience while try to install Ruby on Rails 3 and MySQL on Ubuntu 10.10
\nBased on googling, I found few of problem too and I hope this experience will help everyone.
\n<\/p>\n

<\/div>\n

Installing from terminal:<\/p>\n

STEP #1 {RAILS}<\/h3>\n
\nsudo apt-get install ruby-full\nwget production.cf.rubygems.org\/rubygems\/rubygems-1.3.7.tgz\ntar -xvf rubygems-1.3.7.tgz\ncd rubygems-1.3.7\/\nsudo ruby setup.rb\nsudo ln -s \/usr\/bin\/gem1.8 \/usr\/bin\/gem\nsudo gem install rdoc\nsudo gem install rails\n<\/pre>\n

STEP #2 {MySQL Server}<\/h3>\n
\nsudo apt-get install mysql-server libmysqlclient-dev libmysql-ruby\n<\/pre>\n

STEP #3 {Setting up your first Rails project}<\/h3>\n

It seems ruby using sql lite as default driver, try to install it too. Even you doesn’t need it<\/p>\n

\nsudo apt-get install libsqlite3-dev build-essential\n<\/pre>\n
\nrails new railsapp\ncd railsapp\/\nbundle install\nrake db:create\nrails server -p 3003\n<\/pre>\n

Open url with browser:<\/strong><\/p>\n

\nhttp:\/\/localhost:3003\/\n<\/pre>\n

STEP #4 {PROBLEM HANDLING}<\/h3>\n

This is few or problem that was I received from terminal, when I try to execute bundle install from my application with lof of gems. Few of gem get troubles.
\nA. File not found: lib<\/strong>
\n[SOLUTION]
\nSimply create lib folder in your rails version:<\/p>\n

\nmkdir \/usr\/lib\/ruby\/gems\/1.8\/gems\/rails-3.0.6\/lib\n<\/pre>\n

Then try again to execute #sudo gem install rails
\nB. ERROR: Error installing rails:<\/strong>
\ninvalid gem format for \/usr\/lib\/ruby\/gems\/1.8\/cache\/activerecord-2.0.2.gem
\n-OR-
\ninvalid gem format for \/usr\/lib\/ruby\/gems\/1.8\/cache\/railties-3.0.3.gem
\n[SOLUTION]<\/p>\n

\ncd \/usr\/lib\/ruby\/gems\/1.8\/cache\/\nrm actionpack-2.1.0.gem\ncd \/usr\/local\/rubygems-0.9.5\/\ngem update system\ngem install rails\n<\/pre>\n

Those solution will remove all thing on chace folder, this is cause of “Error installing rails:”
\nC. REINSTALLING ALL GEM<\/strong><\/p>\n

\ngem list --no-versions | sed -e '\/^(*|$)\/d' &gt; installed_gems\nsudo gem uninstall --a --ignore-dependencies .+\ncat installed_gems | xargs sudo gem install\nrm installed_gems\n<\/pre>\n

NOTE:<\/strong> I hope after this line, you will able to run ruby apps on your ubuntu with all of gem needed.
\nReference: <\/strong>
\nhttp:\/\/digg.com\/story\/r\/ruby_on_rails_3_and_mysql_on_ubuntu_10_10
\nhttp:\/\/digg.com\/story\/r\/ruby_ror_tip7_installing_rails3_file_not_found_lib_spritle_s_blog
\nhttp:\/\/digg.com\/story\/r\/ruby_on_rails_blog_of_railshouse_re_installing_all_gems_automatically<\/p>\n

Share on Facebook<\/a><\/p>","protected":false},"excerpt":{"rendered":"

This is my experience while try to install Ruby on Rails 3 and MySQL on Ubuntu 10.10 Based on googling, I found few of problem too and I hope this experience will help everyone. Share on Facebook<\/p>\n

Share on Facebook<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[85,86,128,174,184,271],"_links":{"self":[{"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/posts\/1316"}],"collection":[{"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/comments?post=1316"}],"version-history":[{"count":0,"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/posts\/1316\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/media?parent=1316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/categories?post=1316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dremi.info\/wp-json\/wp\/v2\/tags?post=1316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}