Monday, December 27, 2010

[Sinatra] `union': can't convert Array into String (TypeError) [Resolved]

For The Issue Please Do Following Stapes.

First uninstall gem Rack with all version.

# gem uninstall rack
Select gem to uninstall:
 1. rack-1.0.0
 2. rack-1.0.1
 3. rack-1.2.1
 4. All versions
> 4
Successfully uninstalled rack-1.0.0
Successfully uninstalled rack-1.0.1

You have requested to uninstall the gem:
        rack-1.2.1
thin-1.2.7 depends on [rack (>= 1.0.0)]
sinatra-1.1.2 depends on [rack (~> 1.1)]
oauth-0.3.5 depends on [rack (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Successfully uninstalled rack-1.2.1

root@li107-124:/mnt/ntracker/ntrack# gem list rack
*** LOCAL GEMS ***

# gem install rack --version '1.2.0'
Successfully installed rack-1.2.0
1 gem installed
Installing ri documentation for rack-1.2.0...
Building YARD (yri) index for rack-1.2.0...
Installing RDoc documentation for rack-1.2.0...

Now check your application and config.ru with following content.
--------------------------
require 'sinatra'

Sinatra::Application.default_options.merge!(
  :run => false,
  :env => :production
)

require 'App'
run Sinatra.application
----------------------------

Then Start Application with web proxy thin or anything else.
(development environment)
# thin start -p 4500
>> Using rack adapter
>> Thin web server (v1.2.7 codename No Hup)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4500, CTRL+C to stop
>> Stopping ...

#Use -e for Env. Like this:

# thin start -p 4500 -e staging
or

To start:
# thin -C config/config.yml -R config.ru -e staging start
to stop:
# thin -C config/config.yml -R config.ru -e staging stop

As well as for production.

Thanks-

4 comments:

CD Replication said...

Thanks for posting, this is really what i was searching for, i am going to try this method right now and will let you know about my experience.

Anonymous said...

Your post solved my problem. That was the information I needed to complete deltacloud installation. Thank you very much.

Shrikant Lokhande said...

Thank you Guys. I am so happy that my posts are using and it resolved your issue.
I am requesting all, please put your comment with as registered user, not as "Anonymous" :). it just take 2 min.

Renu said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
Devops Training in electronic city