我是Rails的新手,正在遵循他们网站上的入门指南。
在节中运行$ rake db:migrate时出现错误
它在小节中第一次起作用:
所以我不知道哪里出了问题。
当我运行$ rake db:migrate时
== CreateComments: migrating =================================================
-- create_table(:comments)
rake aborted!
An error has occurred, this and all later migrations canceled:
private me
这是输出。到底是怎么回事?
使用Rails 3.x。我尝试过“创业板清理”,然后是“捆绑安装”,但没有效果。
有人遇到过这种情况吗?
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on dem
为什么我会得到这个错误?
shibly@mybox:~/blog$ rails server
/home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/shibly/.gem/ruby/2.2
在windows中运行cmd时出现错误请告诉我该怎么做:这是rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for
example lib/tasks/capistrano.rake, and they will automatically be available to
Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
requir
我刚刚醒来,无法使用rails的启动rails服务器。我得到以下错误:
$ rails s
c:/Sites/wtna/config/application.rb:9:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from C:/RailsInstaller/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.1.6/lib/rails/commands/server/ser
我在Windows上运行了Rails 3.2.3,并且正在编写这个教程:。当我运行‘guard’(时间4:34)时,我得到以下错误,而不是看到失败。我已经从我的gemfile中删除了minitest。有什么建议吗?
C:\Users\Steven\Documents\Sites\tasks>guard
←[0m
Guard here! It looks like your project has a Gemfile, yet you are running
`guard` outside of Bundler. If this is your in
=> Booting Thin
=> Rails 4.0.13 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/bellobabajide/.rvm/gems/ruby-2.1.5@rightbonus/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `re
我试着安装Sass。在此之前,我安装了RubyandMSYS2,最近一次安装了。
choco install ruby
choco install msys2
表面上看,它们是正确安装的。ruby -v的结果是:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]
当我试图运行gem install sass时,我收到了以下错误消息:
ERROR: Error installing sass:
The last version of ffi (< 2, >= 0.5.0) to support your R
当我尝试安装bcrypt-ruby gem时,会得到以下错误:
我在Windows 732上有Cygwin
$ gem install bcrypt-ruby
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/home/Bartek/.rvm/rubies/ruby-1.9.3-p194/bin/ruby.exe extconf.rb
creatin
我在试着跑
rails server
这是我第一次在新的开发环境(OS X)中遇到以下错误:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/me/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/g
我的rails项目以前工作过。我得到这个错误是因为我删除了mysql和所有与mysql相关的东西。
然后我重新安装了mysql。它得到了这个错误。然后我重新安装了ruby和rails。错误仍然存在。使用"rails new myapp",然后使用"bundle instal",然后使用"rails s",
我得到了以下错误:
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on
=> Run `rails server -h` for
是否遵循中描述的步骤来解决Windows7中bluecloth-2.2.0 gem安装的错误。在上面的链接中给出的步骤4中遇到错误-有什么想法吗?
控制台输出如下。
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0>rake gem
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/Rakefile:24
: Use RbConfig instead of obsolete and deprecated Confi
我已经更新到最新版本的镶边宝石。现在,当我试图运行服务器时,我得到了以下错误:
cannot load such file -- systemu
/home/kiprosh22/.rvm/gems/ruby-1.9.3-p194@liquor/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/kiprosh22/.rvm/gems/ruby-1.9.3-p194@liquor/gems/activesupport-3.2.13/lib/active_support/de
在iOS中运行flutter项目时,出现以下输出错误。 此错误与Cocoapods相关。 请指导我该如何解决它。 之前的错误与我升级到9.0的iOS版本8.0有关,之后我遇到了这个问题,在运行iOS时遇到了错误 CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
F
我收到了一个包,里面有很多技术。当我尝试使用bundle install --local安装这个包时,会出现一个错误,显示事件机没有正确安装,并建议运行gem install eventmachine -v '1.0.3'。当我这样做时,将显示如下信息:
$ gem install eventmachine
Fetching: eventmachine-1.0.3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a wh
我正在用Michael的书Ruby on Rails™ Tutorial: Learn Web Development with Rails, Fourth Edition学习Rails。我在尝试toy_app时得到了错误消息。有人知道怎么回事吗?
Puma caught this error: Invalid option key: raise_on_unfiltered_parameters= (RuntimeError)
.gem/ruby/gems/actionpack-5.0.0/lib/action_controller/railtie.rb:59:in `block (3 lev
我在我的应用程序中有回形针宝石,然后我删除了它,我想重新添加它。然而,当我尝试rake db:migrate时,我得到了这个错误
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to AddAttachmentImageToPosts (20170115210207)
(0.3ms) BEGIN
== 20170115210207 AddAttachmentImageToPosts: m
当尝试运行以下命令时,我会收到一个错误:
jekyll new myblog
错误如下:
/var/lib/gems/1.8/gems/commander-4.1.5/lib/commander/runner.rb:365:in `require_program': program version required (Commander::Runner::CommandError)
from /var/lib/gems/1.8/gems/commander-4.1.5/lib/commander/runner.rb:364:in `each'
from /var/lib/gem
当我在注释对象上调用comment.save时,我得到了一个错误,有什么帮助来调试它吗?
下面是输出:
NoMethodError: undefined method `name' for #<Comment:0x107b4c280>
from /Library/Ruby/Gems/1.8/gems/activemodel-3.0.5/lib/active_model/attribute_methods.rb:364:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/activerecord-3
我有一个.html.erb页面,我正在尝试使用传统的HTML注释来注释掉一些东西:
<!--
User Id (testing MySQL call): <%= @User.uid %>
-->
但是因为它是我注释掉的一个Ruby引用,所以它没有被注释,并且生成了ruby错误。我怎么能注释掉这样的事情呢?我也试过在该行前面加一个#,但也不起作用。
我在中间人中从默认的layout.erb文件切换到等效的layout.haml文件时遇到了麻烦。我想在我的布局中使用HAML,因为我想熟悉它,所以我决定用HAML版本替换默认布局。不幸的是,当我用layout.haml替换layout.erb时,我得到了这个错误:
NoMethodError at /
undefined method `force_encoding' for nil:NilClass
Ruby /Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb: in ensure in binary,
我正在运行第三章中的rspec spec/命令。已使用命令创建sample_app
rails new sample_app -T -database=postgresql
并在运行命令rspec spec/ and时出现以下错误。
C:\Users\ASUS PC\rails_projects\Sample_App>rspec spec
You must 'gem install win32console' to use colour on Windows
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/acti