Sam
Sam

Reputation: 169

Problem with node.js and Redis-server?

I intended to implement a chat feature in my rails application. After a brief backup work I found JUGGERNAUT is the best option. By going to through http://juggernaut.rubyforge.org/ I have successfully implemented the juggernaut in my application.

Presently I'm all set to implement chat feature and after a vigorous surfing over web I couldn't get good tutorial to implement it but I found the some part of implementation at http://www.golygon.com/2010/12/private-chat-room-in-ruby-on-rails-3-0/. I decided to follow it but initially to implement the tutorial we need to have redis server and node.js in our system. I installed both in my environment.

But I'm facing the following problem as follows:

If I try

redis-server, I'm getting the following error

[11440] 08 Aug 10:08:16 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[11440] 08 Aug 10:08:16 # Opening port: bind: Address already in use

and as per the tutorial

if I try

sudo node server.js, I'm getting the following error

[sudo] password for re5: 
node.js:63
    throw e;
    ^
Error: ENOENT, No such file or directory '/home/re5/Documents/task17/server.js'
    at Object.openSync (fs:153:18)
    at Object.readFileSync (fs:94:15)
    at Module._loadScriptSync (node.js:468:39)
    at Module.loadSync (node.js:338:12)
    at Object.runMain (node.js:522:24)
    at Array.<anonymous> (node.js:756:12)
    at EventEmitter._tickCallback (node.js:55:22)
    at node.js:773:9

As I don't know much about the redis and node I'm unable to figure out what was the problem regarding to this errors.

I'm stuck and couldn't go further as I'm not sure whether this two are configured perfectly or not.

currently I'm using rails 3.0.7 and ruby 1.8.7

Can any one help me out.

Upvotes: 2

Views: 1664

Answers (1)

Devin M
Devin M

Reputation: 9752

Well your first error is quite simple to understand.

[11440] 08 Aug 10:08:16 # Opening port: bind: Address already in use

This means that there is aready a server bound to that port and using it as a server, this can happen if you have other applications/servers running or if you try to have mutiple instances of the server run at one time. To fix this you need to stop the process and then start it back up again. You can usually do this by closing all of your terminal windows or using your operating systems process manager to terminate the process, if those methods dont work for you try shutting your computer down and starting it back up. If you are still unable to start the Redis server after this then there are some more steps we can take.

The next error is due to node.js not being able to find a file that it needs. Reinstalling node.js should fix this problem for you.

Let me know if this fixes your problem or if you need more help.

Upvotes: 3

Related Questions