{"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
Installing from terminal:<\/p>\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>\nSTEP #2 {MySQL Server}<\/h3>\n
\nsudo apt-get install mysql-server libmysqlclient-dev libmysql-ruby\n<\/pre>\nSTEP #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>\nOpen url with browser:<\/strong><\/p>\n
\nhttp:\/\/localhost:3003\/\n<\/pre>\nSTEP #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>\nThen 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>\nThose 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' > installed_gems\nsudo gem uninstall --a --ignore-dependencies .+\ncat installed_gems | xargs sudo gem install\nrm installed_gems\n<\/pre>\nNOTE:<\/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