rake gems:install显示错误(数据库不迁移)/

时间:2017-08-03 05:37:55

标签: mysql ruby-on-rails ruby database migration

  1. Ruby:1.8.7
  2. Rails:2.3.8
  3. Db:我的SQL
  4. 创建了数据库,但是当我迁移数据库时,它显示错误。所以如果有人可以帮我解决这个问题,那对我来说没问题。

    $ rake db:migrate
    [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
    DEPRECATION WARNING: Rake tasks in vendor/plugins/active_record_tableless/tasks, vendor/plugins/annotate-models/tasks, vendor/plugins/asset_auto_include/tasks, vendor/plugins/hoptoad_notifier/tasks, vendor/plugins/jrails/tasks, vendor/plugins/sitemap_generator-plugin/tasks, vendor/plugins/thinking-sphinx/tasks, and vendor/plugins/tiny_mce/tasks are deprecated. Use lib/tasks instead. (called from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/tasks/rails.rb:10)
    rake aborted!
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/tinypass-1.0.1/lib/tinypass/builder/client_parser.rb:3: invalid regular expression; there's no previous pattern, to which '{' would define cardinality at 1: /{\w\w\w}/
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/tinypass-1.0.1/lib/tinypass/builder/client_parser.rb:44: invalid regular expression; there's no previous pattern, to which '{' would define cardinality at 2: /^{...}/
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/tinypass-1.0.1/lib/tinypass/builder.rb:2
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/tinypass-1.0.1/lib/tinypass.rb:1
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:307:in `each'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:164:in `process'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:113:in `send'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/initializer.rb:113:in `run'
    /home/aspireedge/Aspiree/***********/config/environment.rb:15
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/****/rails-2.3.8/lib/tasks/misc.rake:4
    Tasks: TOP => db:migrate => environment
    (See full trace by running task with --trace)
    
    启动服务器时,

    也显示错误。所以如果有人可以帮我解决这个问题,那对我来说没问题。

        $ruby script/server 
    => Booting WEBrick
    => Rails 2.3.8 application starting on http://0.0.0.0:3000
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/tinypass-1.0.1/lib/tinypass/builder/client_parser.rb:3: invalid regular expression; there's no previous pattern, to which '{' would define cardinality at 1: /{\w\w\w}/ (SyntaxError)
    /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/tinypass-1.0.1/lib/tinypass/builder/client_parser.rb:44: invalid regular expression; there's no previous pattern, to which '{' would define cardinality at 2: /^{...}/
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/tinypass-1.0.1/lib/tinypass/builder.rb:2
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/tinypass-1.0.1/lib/tinypass.rb:1
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:307:in `each'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:164:in `process'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:113:in `send'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/initializer.rb:113:in `run'
        from /home/aspireedge/Aspiree/************/config/environment.rb:15
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /home/aspireedge/.rvm/gems/ruby-1.8.7-**********/******/rails-2.3.8/lib/commands/server.rb:84
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from script/server:3
    

    当我选择 Client_phaser.rb 的代码时。

        rake db:migrate
    [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
    DEPRECATION WARNING: Rake tasks in vendor/plugins/active_record_tableless/tasks, vendor/plugins/annotate-models/tasks, vendor/plugins/asset_auto_include/tasks, vendor/plugins/hoptoad_notifier/tasks, vendor/plugins/jrails/tasks, vendor/plugins/sitemap_generator-plugin/tasks, vendor/plugins/thinking-sphinx/tasks, and vendor/plugins/tiny_mce/tasks are deprecated. Use lib/tasks instead. (called from /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/tasks/rails.rb:10)
    
    rake aborted!
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:50: odd number list for Hash
            o1: build_offer(request.primary_offer),
               ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:50: syntax error, unexpected ':', expecting '}'
            o1: build_offer(request.primary_offer),
               ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:50: syntax error, unexpected ',', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:52: syntax error, unexpected ':', expecting '='
            v: Config::MSG_VERSION,
              ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:52: dynamic constant assignment
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:53: syntax error, unexpected ':', expecting '='
            cb: request.callback
               ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:54: syntax error, unexpected '}', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:66: odd number list for Hash
            rid: offer.resource.rid,
                ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:66: syntax error, unexpected ':', expecting '}'
            rid: offer.resource.rid,
                ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:67: syntax error, unexpected ':', expecting '='
            rnm: offer.resource.name,
                ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:68: syntax error, unexpected ':', expecting '='
            rurl: offer.resource.url,
                 ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:69: syntax error, unexpected ':', expecting '='
            pos: build_price_options(offer.pricing.price_options),
                ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:69: syntax error, unexpected ',', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:71: syntax error, unexpected '}', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:91: odd number list for Hash
            price: price_option.price || '',
                  ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:91: syntax error, unexpected ':', expecting '}'
            price: price_option.price || '',
                  ^
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:91: syntax error, unexpected ',', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:92: syntax error, unexpected ',', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder/json_msg_builder.rb:94: syntax error, unexpected '}', expecting kEND
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass/builder.rb:4
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/tinypass-1.0.1/lib/tinypass.rb:1
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
    /home/aspireedge/Aspiree/pyromaniac/config/environment.rb:78
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
    /home/aspireedge/.rvm/gems/ruby-1.8.7-head@pyro/gems/rails-2.3.8/lib/tasks/misc.rake:4
    Tasks: TOP => db:migrate => environment
    (See full trace by running task with --trace)
    

2 个答案:

答案 0 :(得分:6)

问题出在tinypass gem中。 README表示该gem需要Ruby 1.9.2或更高版本。

有三种选择:

  1. 查找与ruby 1.8.7版本兼容的tinypass版本。
  2. 分叉这个宝石并实现对旧红宝石的支持。
  3. 更新您的应用程序以使用更新的Ruby。

答案 1 :(得分:1)

regexp中出现错误

尝试使用我的分叉修复:

# Gemfile
gem 'tinypass',
 :git    => 'https://github.com/itsNikolay/ruby-sdk.git',
 :branch => 'fix-regexp'

尝试再次运行迁移