jPlayer and Shoutcast Configuration

Moving to Rails has been great fun, i found myself stuck with a shoucast player that was PHP based. I chose to use Jplayer but the problem is that their documentation isn’t great when it comes to Shoutcast, so my player wasn’t working until the code looked something like this

 

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

    $("#jquery_jplayer_1").jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
                mp3:"http://77.68.106.224:8018;stream/1"
            }).jPlayer("play");
        },

        swfPath: "js",
        supplied: "mp3",
        wmode: "window"
    });
});
//]]>
</script>

ActiveRecord::ConnectionNotEstablished

ActiveRecord::ConnectionNotEstablished – Rails 3.1 is out and i have been busy to start using it.  Yea Yea, i know it’s not an excuse.  Today i decided to create a new app using Rails 3.1.  I have been following the tutorial on Rails Guides, however i am not a fan of SQL lite i always prefer using MYSQL. Anyways

As per tutorial i changed my  config/database.yml to

development:
adapter: mysql2
encoding: utf8
database: blog_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock

I found myself with a error while trying to view my application on http://0.0.0.0:3000.

The solution was fairly simple. I had forgotten a basic step. In my gemfile, i had forgotten to include  the mysql gem

gem "mysql2", "~> 0.3.7"

I commented out the  #gem ‘sqlite3′ gem and everything works. I am posting this because i tried to find a solution on the net but no one seemed to have posted anything about it.  if you are reading this, it means you have the same problem right?

Don’t forget to run bundle install.

Envy Labs Looking for a Senior Rails Developer

Envy Labs Looking for a Senior Rails Developer. Check out their studio. Learnt a lot from these guys.