- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
虽然我不是专家,但我已经在内部开发了一些 Rails 应用程序,用于一些相对中小型项目,并且以前没有遇到过与此类似的问题。
我只是简单地尝试创建一个新应用程序,然后创建一个脚手架,但我收到了关于 sqlite3 gem 的错误。看看这个(我的问题的例子):
[user:ubuntu:~/Documents/rails_apps]$ rails new goku
[user:ubuntu:~/Documents/rails_apps]$ cd goku
[user:ubuntu:~/Documents/rails_apps/goku]$ rails g scaffold FindingName name:text
Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError)
gem 'sqlite3', '~> 1.3', '>= 1.3.6'
到 gemfile,但这对我没有任何作用。
[user:ubuntu:~/Documents/rails_apps/goku]$ bundle install 4:47PM/02.06
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.5.3
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.1
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2
Using globalid 0.4.2
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.2
Using public_suffix 3.0.3
Using addressable 2.6.0
Using io-like 0.3.0
Using archive-zip 0.11.0
Using bindex 0.5.0
Using msgpack 1.2.6
Using bootsnap 1.3.2
Using bundler 1.16.2
Using byebug 10.0.2
Using regexp_parser 1.3.0
Using xpath 3.2.0
Using capybara 3.13.2
Using ffi 1.10.0
Using childprocess 0.9.0
Using chromedriver-helper 2.1.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2
Using coffee-rails 4.2.2
Using multi_json 1.13.1
Using jbuilder 2.8.0
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using ruby_dep 1.5.0
Using listen 3.1.5
Using puma 3.12.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2
Using rubyzip 1.2.2
Using sass-listen 4.0.0
Using sass 3.7.3
Using tilt 2.0.9
Using sass-rails 5.0.7
Using selenium-webdriver 3.141.0
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Using sqlite3 1.4.0
Using turbolinks-source 5.2.0
Using turbolinks 5.2.0
Using uglifier 4.1.20
Using web-console 3.7.0
Bundle complete! 18 Gemfile dependencies, 79 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
[user:ubuntu:~/Documents/rails_apps/goku]$ rails g scaffold FindingName name:text 4:47PM/02.06
invoke active_record
Traceback (most recent call last):
70: from bin/rails:4:in `<main>'
69: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
68: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
67: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
66: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
65: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
64: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
63: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
62: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
61: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
60: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
59: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
58: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
57: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
56: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
55: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/commands/generate/generate_command.rb:26:in `perform'
54: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/generators.rb:276:in `invoke'
53: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
52: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/group.rb:232:in `dispatch'
51: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `invoke_all'
50: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `map'
49: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `each'
48: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `block in invoke_all'
47: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
46: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
45: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/group.rb:134:in `_invoke_from_option_orm'
44: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/group.rb:266:in `_invoke_for_class_method'
43: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/shell.rb:68:in `with_padding'
42: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/group.rb:277:in `block in _invoke_for_class_method'
41: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
40: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/group.rb:232:in `dispatch'
39: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `invoke_all'
38: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `map'
37: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `each'
36: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `block in invoke_all'
35: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
34: from /home/user/.rvm/gems/ruby-2.5.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
33: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/rails/generators/active_record/model/model_generator.rb:22:in `create_migration_file'
32: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/generators/named_base.rb:92:in `table_name'
31: from /home/user/.rvm/gems/ruby-2.5.1/gems/railties-5.2.2/lib/rails/generators/named_base.rb:201:in `pluralize_table_names?'
30: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
29: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
28: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
27: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
26: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
25: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
24: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
23: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
22: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/base.rb:27:in `<main>'
21: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/base.rb:328:in `<module:ActiveRecord>'
20: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
19: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `each'
18: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
17: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
16: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
15: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
14: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
13: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
12: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:60:in `establish_connection'
11: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:in `establish_connection'
10: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
9: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
8: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
7: from /home/user/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
6: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
5: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
4: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
3: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2: from /home/user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
1: from /home/user/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.2/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError)
最佳答案
错误指出它找不到 sqlite3 ~> 1.3.6
的版本所以这就是你的 Gemfile 应该要求的:
gem 'sqlite3', '~> 1.3.6'
gem 'sqlite3', '~> 1.3', '>= 1.3.6'
更宽松的定义这也将允许
1.4
仅对 rails 的 master 分支有效。
1.3.6
:
# In Gemfile
gem 'rails', '~> 5.2.2.1'
关于ruby-on-rails - 全新的 Rails 应用,无法生成脚手架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54563777/
我读了here您可以使用命令构建模块,因此您无需手动创建一些初始文件。但是这样的命令在 master 上不起作用(在 Odoo 开发分支上): ./oe scaffold Academy ../my-
我是 Grails 新手。我有一个 Person 域类: class Person { String firstName String lastName String gend
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我使用 yeoman 作为脚手架工具,但出现以下错误。任何人都可以帮我解决这个问题。我正在使用 Windows 8 环境。 karma-jasmine@0.1.5 node_modules\karma
我正在查看使用grails generate-all生成的 Controller 。为什么同时存在create和save操作,是否有原因?对于我来说,仅将create作为操作并将save作为服务对我来
我是个新手。我现在正在研究脚手架模板,尤其是在 Controller 上。我每次生成时都想要一个自定义的 Controller ,所以我使用了“安装模板”。我总是在 Controller 上创建Com
我有一个类库,其中包含一些模型类和一个 DbContext 类(所有这些类都是公共(public)的)。该类库由 MVC-5 应用程序引用。 是否可以使用该引用类库中的模型类来构建该 MVC-5 应用
我有一个使用 Twitter Bootstrap 构建的单页应用程序。我的应用程序有几个模态对话框,它们通常占页面宽度的 70%,并且水平居中。我的页面和模态设置是这样的: 我在模态框内放置了一行和几
我正在开发一个具有某种“协调器”界面的网络应用程序。我希望能够支持我正在使用的 Eyefinity 设置(即 3 个纵向显示器,分辨率为 3600x1920,或 3780x1920,并启用了边框校正)
在处理 codeigniter 中的脚手架时,我有哪些选择 - 人们经常使用脚手架吗?或者是否有更好的方法来快速生成用于 CRUD 应用程序的代码? 我已经安装了 Spark 塞:http://cod
我正在我工作的公司解决方案中实现存储库模式,将后端项目中的模型类与 DbContexts 项目中的数据库上下文和迁移分开。 我正在使用 Scaffold-DbContext 将我的后端项目设置为模型类
目录 1、前言 2、什么是脚手架呢? 3、谁提供了脚手架? 1、Spring 官网脚手架 2、阿里云脚手架 4、手撸一个脚手架!
我在脚手架中有一个应用栏。 return Scaffold( appBar: styling.appBar( AppBar( leading: styling.icon
我正在尝试使用 Compose 设计一个布局,其中包括: 热门应用栏 正文(内容) 底部应用栏 单击时表示菜单的底部表(模态底部表) -------TopAppBar------ ------主要内容
有谁知道如何为所有对象属性“构建”或“生成”构造函数块?我有 VS2010 和 Resharper,我希望生成类似的东西: public Customer CustomerB = new Cu
我正在尝试在 grails 中上传文件。生成的脚手架对我不起作用,给我一个 404 寻找“save.jsp” 域名 class Simple{ byte [] avatar static co
因为我已经手动调整了我的实体和 Controller 以及 View ,所以我希望 roo 不更改它们中的任何一个。尽管如此,我还是希望继续为所有新实体搭建脚手架。我怎么能那样做 最佳答案 您可以通过
我使用命令grails generate-restful-controller Domain创建了一个 Restful Controller ,如何在创建的 Controller 中设置scaffol
我有一个定义了 staticscaffold = true 的 Controller ,以及一些自定义操作。 我想确保只有登录用户和 ADMIN 类型的用户(我们域中的某些 Enum 值)才能访问它。
我有一个表,其中某些列的值相对较长,并且在我的 Grails 应用程序中为其打开了动态脚手架(我使用的是 Grails 3.3.8)。因此,在某些屏幕分辨率下,它们不适合屏幕,并且最右边的列最终会出现
我是一名优秀的程序员,十分优秀!