Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Wednesday, 15 August 2012

error installing mysql with native extensions

Hi,

Here is the error with mysql on bundle install in my system


Installing mysql (2.8.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... 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
--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=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql-2.8.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
An error occured while installing mysql (2.8.1), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.8.1'` succeeds before bundling.


I have searched in google and came to see its missing some required libraries i.e 'libmysqlclient15-dev'

To install the 'libmysqlclient15-dev' library run the below command,

> sudo apt-get install libmysqlclient15-dev


Now it will solve the above issue.

Thank You,
Uma Mahesh.

cannot load such file -- zlib

Hi,

I have faced issue with zlib while installing rails.

Here is the error

root@umamahseh-desktop:/home/umamahseh# gem install rails

ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand


I have solved the issue by installing mysql in my system. Use Ubuntu software center for installing mysql client and mysql server.


Thank You,
Uma Mahesh.

Tuesday, 14 August 2012

Installing Ruby On Rails in Ubuntu 12.04 LTS


Hi,

The latest version of Ubuntu 12.04 was relaesed, Ubuntu 12.04 LTS (Long Term Support)

Installing Ruby On Rails is easy and cane be done using RVM.

Here are the simple steps for installation

1) Install CURL
> sudo apt-get install curl

2) Install GIT
> sudo apt-get install curl git-core

3) Install RVM and Dependencies
> curl -L get.rvm.io | bash -s stable

Once that’s done, we’re going to need to add a line to ~/.bashrc file (the file responsible for setting up our bash session) which will load RVM. Do this by running this command in the terminal:


echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc 

Then we’ll need to reload the ~/.bashrc file which we can do with this small command:

. ~/.bashrc



4) Then install additional dependencies specified by the RVM
> rvm requirements

The above command will list all the requirements.
> sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

5) Installing Javascript Runtime
> sudo apt-get install nodejs

6) Install ruby
> rvm install 1.9.3
> ruby -v

Now it should display the ruby version that was installed in your system


7) Install Rails
> gem install rails


Now you are done with Installation of Ruby On Rails in your Ubuntu system. Now you can start creating rails application.


Help full links: RVM Installations - https://rvm.io/rvm/install/


Thank You,
Uma Mahesh.