【问题标题】:Rails Tutorial for Devise with CanCan and Twitter Bootstrap使用 CanCan 和 Twitter Bootstrap 进行设计的 Rails 教程
【发布时间】:2012-11-05 09:08:39
【问题描述】:

无法使用 Ruby 版本 1.9.3p286 和 Rails 3.2.8 运行这个开源项目 http://railsapps.github.com/tutorial-rails-bootstrap-devise-cancan.html.I'm。 我已经成功安装了所有 gem,但是在尝试从 RubyMine 输出运行时 以下:

/Users/st/.rvm/rubies/ruby-1.9.3-p286/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/st/projects/rails3-bootstrap-devise-cancan/script/rails server -b 0.0.0.0 -p 3000 -e development
/Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find diff-lcs-1.1.3 in any of the sources (Bundler::GemNotFound)
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `map!'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `materialize'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/definition.rb:158:in `specs_for'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/definition.rb:147:in `requested_specs'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/environment.rb:23:in `requested_specs'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:11:in `setup'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler.rb:116:in `setup'
    from /Users/st/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/setup.rb:17:in `<top (required)>'
    from /Users/st/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/st/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/st/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/st/projects/rails3-bootstrap-devise-cancan/config/boot.rb:6:in `<top (required)>'
    from /Users/st/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/st/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/st/projects/rails3-bootstrap-devise-cancan/script/rails:5:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'
Process finished with exit code 1

我的宝石文件:

source 'https://rubygems.org'
gem 'rails', '3.2.8'
gem 'sqlite3'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "rspec-rails", ">= 2.11.0", :group => [:development, :test]
gem "email_spec", ">= 1.2.1", :group => :test
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
gem "database_cleaner", ">= 0.8.0", :group => :test
gem "launchy", ">= 2.1.2", :group => :test
gem "capybara", ">= 1.1.2", :group => :test
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
gem "bootstrap-sass", ">= 2.1.0.0"
gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.0.3"
gem "quiet_assets", ">= 1.0.1", :group => :development

【问题讨论】:

    标签: ruby-on-rails ruby device cancan twitter-bootstrap-rails


    【解决方案1】:

    找不到diff-lcs-1.1.3 gem,尝试运行 bundle install 或手动安装 gem。

    编辑:看到你的 gem 文件,它不见了

    gem "diff-lcs", "1.1.3"
    

    【讨论】:

    • 添加了 gem "diff-lcs"、"1.1.3",但现在 RubyMine 打印在任何源中都找不到 multi_json-1.3.6 (Bundler::GemNotFound)
    • 也添加一个,以及它可能抱怨的任何其他内容。
    【解决方案2】:

    对@Baboon 的解决方案的一点补充,尝试删除Gem.lock 文件并再次运行bundle install

    但是,一旦您对示例感到满意,您可能会对 "rails composer" 感兴趣以生成您的 Rails 骨架

    HTH

    【讨论】:

    • 试图删除 gem.lock 文件并运行 bundle install 但它对我没有帮助,感谢 rails composer!
    • 来自@sameera207 的好建议。使用 Rails Composer 生成应用程序。并阅读作者关于安装 Rails 的这篇文章:railsapps.github.com/installing-rails.html
    猜你喜欢
    • 2013-09-04
    • 1970-01-01
    • 2013-08-08
    • 1970-01-01
    • 2013-12-12
    • 1970-01-01
    • 2013-01-02
    • 1970-01-01
    • 2016-05-09
    相关资源
    最近更新 更多