taps migration failing from sqlite to postgres rails4, ruby 1.9.3

后端 未结 3 660
萌比男神i
萌比男神i 2021-01-13 09:07

I am trying to migrate my Rails app to Postgresql for heroku however i can\'t get taps to get the data from my SQLite3 database, here is what i have tried:

C

相关标签:
3条回答
  • 2021-01-13 09:25

    Thank you @DavidKarlsson, just adding to your answer, there is no need to uninstall the existing rack. Following the recommendation of @hak8or in https://github.com/ricardochimal/taps/issues/128 I used a Gemfile to ensure usage of rack version 1.0.1. But after I installed I had various versions of rack

    $ 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
    

    and did not want to uninstall them, because that could affect other projects I have in the same machine. When I run taps it would use the latest, rack-1.5.2, so what I did was to run taps using bundle exec, in my case

    bundle exec taps server sqlite://db/development.sqlite3 root root
    

    Hope it helps!

    0 讨论(0)
  • 2021-01-13 09:31

    This worked for me:

    1. I went up one directory from my project directory then did the following
    2. gem install taps
    3. gem uninstall rack
    4. gem install rack --version 1.0.1

    Start the sqlite server from the project directory, in the 'one up directory' run:

    taps pull postgres://f3@localhost/f3_development http://user:password@localhost:5000
    

    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'm using ruby 2.0.0-p0 and rails 4.0.0.beta1

    It seems only the pull command needed the old version of rack so the server could run on the newer 1.5.2 version...

    0 讨论(0)
  • 2021-01-13 09:43

    @David Karlsson's answer worked for me too. Except I had to update back rack once taps has completed the pull

    gem update rack
    

    and run bundle install to get back all my gems working.

    I'm on rails 3.2 and ruby 1.9.3

    0 讨论(0)
提交回复
热议问题