Open adasfan opened 11 years ago
same problem here !
FWIW I had a similar error:
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
I was running the taps command from a directory one level up from my app and was using my global gem set. My app is rails 3.1.3, and uses rmv to manage the gem set. So running one level up would have been using my global gemset.
Anyway, when I re-ran taps server and taps pull from inside my project directory, it worked fine.
Same problem here! Didn't work from inside my project directory either :(
localhost - - [09/Mar/2013:06:13:21 EST] "GET /sessions/9685932778/pull/table_names HTTP/1.1" 500 529
I just had the same issue and solved it by using exactly the gem versions specified in gemspec, rather than latest version allowed by gemspec. It seems that one of the gems had a regression and taps didn't update gemspec to exclude that version.
Appears to work with rack 1.0.1 gem "rack", "1.0.1"
@flingbob this fixed the problem for me.. thanks for the tip.
What version of rails are you using? My app won't let me downgrade that far ...
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 3.2.11) ruby depends on
rack (~> 1.4.0) ruby
rack (1.0.1)
Are you adding this to your Rails app's Gemfile? You don't have to, unless your Rails app depends on it during runtime (which I'd find unusual). Taps doesn't require Rails.
ok, cool. Then from the command line how do I get taps to use a specific version of rack?
Thanks!
Steve
On Mar 27, 2013, at 3:58 PM, Eugene Gilburg notifications@github.com wrote:
Are you adding this to your Rails app's Gemfile? You don't have to, unless your Rails app depends on it during runtime (which I'd find unusual). Taps doesn't require Rails.
— Reply to this email directly or view it on GitHub.
Run the command from a new folder not under Rails root, and add a separate Gemfile there?
Hi again,
Yeah, tried that:
wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'
then ran bundle then ran the taps pull and got the same error.
How is it currently working for you? What's your set-up look like?
Thanks.
Steve
On Mar 27, 2013, at 4:03 PM, Eugene Gilburg notifications@github.com wrote:
Run the command from a new folder not under Rails root, and add a separate Gemfile there?
— Reply to this email directly or view it on GitHub.
Change rack to 1.0.1 in that Gemfile you just created
On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com wrote:
Hi again,
Yeah, tried that:
wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'
then ran bundle then ran the taps pull and got the same error.
How is it currently working for you? What's your set-up look like?
Thanks.
Steve
On Mar 27, 2013, at 4:03 PM, Eugene Gilburg notifications@github.com wrote:
Run the command from a new folder not under Rails root, and add a separate Gemfile there?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .
Same error:
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands
Tried with ruby 1.9.2 and 1.9.3.
Thanks,
Steve
On Mar 27, 2013, at 5:53 PM, Eugene Gilburg notifications@github.com wrote:
Change rack to 1.0.1 in that Gemfile you just created
On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com wrote:
Hi again,
Yeah, tried that:
wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'
then ran bundle then ran the taps pull and got the same error.
How is it currently working for you? What's your set-up look like?
Thanks.
Steve
On Mar 27, 2013, at 4:03 PM, Eugene Gilburg notifications@github.com wrote:
Run the command from a new folder not under Rails root, and add a separate Gemfile there?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .
— Reply to this email directly or view it on GitHub.
Any other suggestions?
Thanks,
Steve
On Mar 27, 2013, at 6:57 PM, Steve Fox steve@wiscota.com wrote:
Same error:
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands
Tried with ruby 1.9.2 and 1.9.3.
Thanks,
Steve
On Mar 27, 2013, at 5:53 PM, Eugene Gilburg notifications@github.com wrote:
Change rack to 1.0.1 in that Gemfile you just created
On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com wrote:
Hi again,
Yeah, tried that:
wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'
then ran bundle then ran the taps pull and got the same error.
How is it currently working for you? What's your set-up look like?
Thanks.
Steve
On Mar 27, 2013, at 4:03 PM, Eugene Gilburg notifications@github.com wrote:
Run the command from a new folder not under Rails root, and add a separate Gemfile there?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .
— Reply to this email directly or view it on GitHub.
Sorry, not sure then. Perhaps try using other exact gem versions as I posted earlier. If not, can't help you, sorry
ok. Thanks.
On Mar 28, 2013, at 2:52 PM, Eugene Gilburg notifications@github.com wrote:
Sorry, not sure then. Perhaps try using other exact gem versions as I posted earlier. If not, can't help you, sorry
— Reply to this email directly or view it on GitHub.
This worked for me.
Then did the migration as before and it worked. I had rack 1.5.2 installed so I had to remove that and replace it with rack 1.0.1. I also reversed the above process once I was done to restore my gem versions to original state. I'm using ruby 2.0.0-p0 and rails 4.0.0.beta1
No luck. Followed your steps. I even created an empty Gemfile in there and added
gem 'rack','1.0.1'
and ran bundle.
I may check out options other than taps to pull this off, but will keep working on this, too.
Thanks,
Steve
On Apr 1, 2013, at 7:10 PM, Ansh25 notifications@github.com wrote:
This worked for me.
- I went up one directory from my project directory then did the following
- gem install taps
- gem uninstall rack
- gem install rack --version 1.0.1
Then did the migration as before and it worked. I had rack 1.5.2 installed so I had to remove that and replace it with rack 1.0.1. I also reversed the above process once I was done to restore my gem versions to original state. I'm using ruby 2.0.0-p0 and rails 4.0.0.beta1
— Reply to this email directly or view it on GitHub.
@cheeby I encountered this issue as well. Starting with @Ansh25 's advice, I moved up a directory and created a new Gemfile with this:
gem 'rack','1.0.1'
gem 'taps'
gem 'sqlite3'
gem 'pg'
At first I tried just specifying rack, but taps was already configured with rack 1.5, so I added taps to my new gemfile. You also need to add the gems for the database drivers. For me I was migrating sqlite to pg. Once I bundle installed with this gemfile I was able to restart taps and run the pull. Hope that helps.
@Ansh25 Worked perfectly - thanks!
rack 1.5.2 was not working for me with the same error. I uninstalled it and installed back rack version 1.2.5 and it worked.
Weird. On a completely different machine - brand new iMac - I've rebuilt the database, created a fresh postgresql database and then created a Gemfile in a new directory, added the items specified by @cameronbot and am getting the same error on doing a taps pull:
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands
Any other insight is appreciated.
Thanks,
Steve
@Ansh25 Thanks as well for your workaround! Worked perfectly!
I added gem 'rack','1.0.1'
to beginning of bin/taps, works well. Thank you
@Paxa worked for me as well. Thanks.
@Ansh25 worked great for me as well, thanks.
This still does not seem to be fixed that well if you get the gem from rubydocs.
Here is what I did:
get out of your rails folder and make a folder called tmp.
cd temp
make a Gemfile containing and save it:
Put the following into the gemfile
source 'https://rubygems.org'
gem 'rack','1.0.1'
gem 'taps'
gem 'sqlite3'
gem 'pg'
run bundle from a terminal within that folder, which should give you results like this:
hak8or@ubuntu:~/tmp$ bundle
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using mime-types (1.23)
Using pg (0.15.1)
Installing rack (1.0.1)
Using rest-client (1.6.7)
Using sequel (3.20.0)
Using sinatra (1.0)
Using sqlite3 (1.3.7)
Installing taps (0.3.24)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Copy the db folder from your rails application into your tmp folder, so now the folder contents should look like this:
Gemfile
Gemfile.lock
db
Now from the terminal within that folder run what you were doing earlier but add bundle exec. You should get something like this:
hak8or@ubuntu:~/tmp$ bundle exec taps server sqlite://db/development.sqlite3 hak8or secret
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2013-07-16 11:10:32] INFO WEBrick 1.3.1
[2013-07-16 11:10:32] INFO ruby 2.0.0 (2013-06-27) [x86_64-linux]
[2013-07-16 11:10:32] INFO WEBrick::HTTPServer#start: pid=3765 port=5000
And from that point run everything like you would normally and it should work fine. This is what fixed it for me.
@hak8or Worked perfectly for me, thanks a lot
@hak8or This did the trick for me as well. Thanks.
@hak8or Thanks so much.
@MaxCloutier @zakstern @MCodyB You are all most welcome! :)
@Ansh25 Thank you!!!
@cameronbot & @hak8or thank you!!
@Ansh25 Worked, thank you for ending days of aggravation.
You can add add gem 'rack',’1.0.1’ to gemfile and run bundle update rack. This worked for me. Thanks guys.
@alagram's suggestion worked for me. thanks!
I have tried @hak8or but when I run taps from the temp/ folder I see that rack is still on version 1.5.2 which is the latest version I have installed.
In the Gemfile.lock it is clear
$ cat Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
mime-types (2.0)
pg (0.15.1)
rack (1.0.1)
rest-client (1.6.7)
mime-types (>= 1.16)
sequel (3.20.0)
sinatra (1.0)
rack (>= 1.0)
sqlite3 (1.3.8)
taps (0.3.24)
rack (>= 1.0.1)
rest-client (>= 1.4.0, < 1.7.0)
sequel (~> 3.20.0)
sinatra (~> 1.0.0)
PLATFORMS
ruby
DEPENDENCIES
pg (= 0.15.1)
rack (= 1.0.1)
sqlite3
taps
But when I run taps
$ taps server sqlite://db/development.sqlite3 root root
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2013-12-17 17:12:00] INFO WEBrick 1.3.1
[2013-12-17 17:12:00] INFO ruby 2.0.0 (2013-06-27) [x86_64-darwin12.3.0]
[2013-12-17 17:12:00] INFO WEBrick::HTTPServer#start: pid=5544 port=5000
127.0.0.1 - root [17/Dec/2013 17:12:08] "GET / HTTP/1.1" 200 - 0.0012
localhost - - [17/Dec/2013:17:12:08 CET] "GET / HTTP/1.1" 200 31
- -> /
127.0.0.1 - root [17/Dec/2013 17:12:08] "POST /sessions HTTP/1.1" 200 - 0.0051
localhost - - [17/Dec/2013:17:12:08 CET] "POST /sessions HTTP/1.1" 200 46
- -> /sessions
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
/Users/idejuan/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
As you can see, rack is on version 1.5.2
If I see what versions of rack I have installed,
$ gem uninstall 'rack'
Select gem to uninstall:
1. rack-1.0.1
2. rack-1.4.4
3. rack-1.4.5
4. rack-1.5.2
5. All versions
>
But I would not like to uninstall other versions, since I fear this could affect other projects I have in the same machine...
Is there anyway I can enforce taps to use rack 1.0.1?
thank you for your help
-- UPDATE --
Ok I just found the solution, use bundle exec
before the command taps
bundle exec taps server sqlite://db/development.sqlite3 root root
@Ansh25 Your suggestion worked for me as well. Thanks!
@idejuan
Very late, but I figured I would update my fix and do some formatting with your information.
@Ansh25 Your solution works a charm. Cheers!
Added gem 'rack','1.0.1' to beginning of bin/taps. This worked like a charm. Thank you.
@hak8or thanks! worked well for me!
I tried every possible way to do this, but everytime I am having the same problem Failed to connect to database: Sequel::DatabaseConnectionError -> PG::ConnectionBad: fe_sendauth: no password supplied
I tried to follow hak8or advice The gem file looks same as that of hak8or but the gemfile.lock give different versions of the the gem installed. Any fullproof solution to the problem?
I am using rails 4.1 and ruby 2.1.1
@Paxa's solution is the easiest
@hak8or thanks a million! worked brilliantly for me.
@hak8or Worked like charm! Thanks!
Another thanks to @hak8or !
@hak8or Thank you so much
@hak8or Thanks!
@paxa what does this mean?
Add gem 'rack','1.0.1' to bin/taps
taps is a ruby script, adding that line is a syntax error.
I am trying to pull a db from MySQL into Postgres. "blogs" is the name of the one the tables in the db.
I see the error "Unable to fetch tables information from http://mcetin:secret@localhost:5000. Please check the server log" error message from the taps pull side.
Here is the call stack from the taps server side: localhost - - [24/Feb/2013:23:00:47 EST] "GET /sessions/8471611000/pull/table_names HTTP/1.1" 500 518
valenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in
block in arrenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:inmap' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in
arrenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:inencode' /.../.rvm/gems/ruby-1.9.3-p362/gems/taps-0.3.24/lib/taps/server.rb:157:in
block in class:Server' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:865:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:865:in
block in route' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:521:ininstance_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:521:in
route_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:500:inblock (2 levels) in route!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:497:in
catch' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:497:inblock in route!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:476:in
each' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:476:inroute!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:601:in
dispatch!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:411:inblock in call!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
instance_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:inblock in invoke' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
catch' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:ininvoke' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:411:in
call!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:399:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/deflater.rb:25:in
call' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in
call' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:979:inblock in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in
synchronize' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:979:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in
service' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:138:inservice' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:94:in
run' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :blogs