在rails 3.2中实现bundle install时出错

时间:2013-03-05 10:29:46

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2 bundler

我刚刚开始了一个名为图书馆管理系统的新项目。在Windows XP 32 bit中运行bundle install时。我还在我的系统上安装了Python 3.3。我收到以下错误。

    D:\Projects\Library>bundle install
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/
dsl.rb:7:in `instance_eval': D:/Projects/Library/Gemfile:27: syntax error, unexp
ected tDOT2, expecting $end (SyntaxError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/dsl.rb:7:in `evaluate'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/definition.rb:17:in `build'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler.rb:138:in `definition'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/cli.rb:219:in `install'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/task.rb:22:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor.rb:263:in `dispatch'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/base.rb:386:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/bin/bundle:13:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in `load'
        from C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in `<main>'

我的Gemlock文件如下: -

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.11)
      actionpack (= 3.2.11)
      mail (~> 2.4.4)
    actionpack (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.11)
      activesupport (= 3.2.11)
      builder (~> 3.0.0)
    activerecord (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
    activesupport (3.2.11)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    api_taster (0.6.0)
      bootstrap-sass (~> 2.1)
      jquery-rails
      rails (>= 3.1.0)
      redcarpet
      remotipart (~> 1.0)
      sass-rails
    arel (3.0.2)
    bcrypt-ruby (3.0.1)
    bcrypt-ruby (3.0.1-x86-mingw32)
    bootstrap-sass (2.2.2.0)
      sass (~> 3.2)
    bootswatch-rails (0.4.0)
      railties (>= 3.1)
    builder (3.0.4)
    carrierwave (0.8.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.5.0)
    commonjs (0.2.6)
    devise (2.2.1)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.4)
    journey (1.0.4)
    jquery-rails (2.2.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.7.7)
    less (2.2.2)
      commonjs (~> 0.2.6)
    less-rails (2.2.6)
      actionpack (>= 3.1)
      less (~> 2.2.0)
    less-rails-bootstrap (2.2.1)
      less-rails (~> 2.2.0)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.21)
    multi_json (1.6.1)
    orm_adapter (0.4.0)
    pg (0.14.1)
    pg (0.14.1-x86-mingw32)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-protection (1.3.2)
      rack
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.11)
      actionmailer (= 3.2.11)
      actionpack (= 3.2.11)
      activerecord (= 3.2.11)
      activeresource (= 3.2.11)
      activesupport (= 3.2.11)
      bundler (~> 1.0)
      railties (= 3.2.11)
    railties (3.2.11)
      actionpack (= 3.2.11)
      activesupport (= 3.2.11)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.3)
    rdoc (3.12.2)
      json (~> 1.4)
    redcarpet (2.2.2)
    redis (3.0.2)
    redis-namespace (1.2.1)
      redis (~> 3.0.0)
    remotipart (1.0.2)
    resque (1.23.0)
      multi_json (~> 1.0)
      redis-namespace (~> 1.0)
      sinatra (>= 0.9.2)
      vegas (~> 0.1.2)
    resque-scheduler (2.0.0)
      redis (>= 2.0.1)
      resque (>= 1.20.0)
      rufus-scheduler
    rufus-scheduler (2.0.17)
      tzinfo (>= 0.3.23)
    sass (3.2.6)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sinatra (1.3.3)
      rack (~> 1.3, >= 1.3.6)
      rack-protection (~> 1.2)
      tilt (~> 1.3, >= 1.3.3)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.17.0)
    tilt (1.3.4)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    twitter-bootstrap-rails (2.2.4)
      actionpack (>= 3.1)
      execjs
      railties (>= 3.1)
    tzinfo (0.3.35)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    vegas (0.1.11)
      rack (>= 1.0.0)
    warden (1.2.1)
      rack (>= 1.0)

PLATFORMS
  ruby
  x86-mingw32

DEPENDENCIES
  api_taster
  bootswatch-rails
  carrierwave
  coffee-rails (~> 3.2.1)
  devise
  execjs
  jquery-rails
  less-rails-bootstrap
  pg
  rails (= 3.2.11)
  resque
  resque-scheduler
  sass-rails (~> 3.2.3)
  twitter-bootstrap-rails
  uglifier (>= 1.0.3)

我的Gemfile: -

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'sqlite3'

gem 'pg'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
 #  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'carrierwave'
                  <-----Line 27 
gem 'devise'

gem 'resque'
gem 'resque-scheduler', :require => 'resque_scheduler'

gem 'api_taster'

gem 'twitter-bootstrap-rails'

gem 'less-rails-bootstrap'

gem 'execjs'

# gem 'therubyracer'

gem 'bootswatch-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
你能帮助我吗?

3 个答案:

答案 0 :(得分:1)

现在好了,你已经发现了我建议安装'bootstrap-sass'宝石的问题,我知道它可以100%工作。

我碰巧回答了一个类似的问题,所以这里是链接: how to use that gem and why

答案 1 :(得分:1)

似乎宝石'twitter-bootstrap-rails'和gem'less-rails-bootstrap'give错误。 我在db:create期间收到错误。

C:\Sites\Library>rake db:create
[WARNING] Please install gem 'therubyracer' to use Less.
rake aborted!
cannot load such file -- v8
C:/Sites/Library/config/application.rb:7:in `<top (required)>'
C:/Sites/Library/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

所以我删除了它们。相反,我去了'bootstrap-sass'宝石来实现rails中的bootstrap,它似乎对我来说很好。 不知道我是否正确

答案 2 :(得分:1)

您可以从头开始重新启动项目,而不是完成所有这些操作。 请相应更新gemfile