我对Rails很陌生。此应用程序在我的本地机器上运行良好,部署时没有任何问题。但是,当我运行heroku run rake db:migrate时,我会得到以下错误:
Running `rake db:migrate` attached to terminal... up, run.1269
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile.
我的Gemfile中有sqlite3 gem。运行'bundle install‘可以正常工作,没有错误。使用Rake运行数据库迁移时:
rake db:create_migration NAME=create_messages
我得到以下错误:
rake aborted!
LoadError: Could not load 'active_record/connection_adapters/sqlite_adapter'. Make sure that the adapter in config/database.yml is valid. If you use a
我是Rails的新手,所以请原谅我对Rails缺乏理解。我已经通过RubyGems安装了最新版本的RubyGems、Ruby、Rails、Rake和MySQL等,但是当我开始开发一个基本的Rails应用时,我遇到了这个问题:
Icarus:temporary atg$ rails new people
... (output omitted) ...
Icarus:temporary atg$ cd people
Icarus:people atg$ rake db:create
(in /Users/atg/temporary/people)
rake aborted!
uninit
我正在遵循Ruby on Rails的指南,在使用gem "Faker“生成虚假内容时遇到了一个问题。我安装了faker,并按照说明将用户和照片填充到我的项目中。我在lib/task/populate.rake中创建了这个文件
lib/task/placate.rake
namespace :db do
desc "Fill database with sample data"
task populate: :environment do
10.times do |n|
puts "[DEBUG] creating user #{n+
我使用的是rbenv和Ruby1.9.2-P290,Rails3.1,数据库是MySQL。
当我尝试的时候
rake db:create
我得到以下错误:
Could not find multi_json-1.0.3 in any of the sources
我也尝试过bundle exec rake db:create。
我的GemFile看起来像这样:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'mysql2'
gem 'json'
gr
我想做什么,发生了什么
我在本地做了一个rails应用程序。我想把它部署到heroku。
我试过这个:
$ git push heroku master
,但我收到了如下错误消息:
remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the prod
我有一个有几个表的项目,还处于早期开发阶段。我需要对迁移做一些更改,并希望回滚以正确地完成它。这些都是微小的更改,我更喜欢直接编辑迁移,而不是创建更改迁移。
当我运行rake db:rollback时,会得到以下异常:
wrong number of arguments (1 for 0)/Users/mmo/.rvm/gems/ruby-2.2.4/gems/activerecord-4.2.5/lib/active_record/migration.rb:492:in `initialize'
这个数据库是全新的--我刚做了rake db:drop db:migrate。
rake
我有以下错误。你能告诉我如何解决它们吗?在此之前,非常感谢您。
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem) An error occurred while installing rake (10.4.2), and Bundler cannot continue. Make sure that
我在Ubuntu中执行了git克隆和包install.Then,我执行了包exec rake db:migrate。
我收到了这个警告
~/Siva/Clone/gitlabhq$ bundle exec rake db:迁移
警告:此版本的GitLab依赖于gitlab-shell2.6.3,但您运行的是未知版本。请更新gitlab-shell。
20141121133009 AddTimestampsToMembers:迁移执行(“UPDATE members SET created_at = now() WHERE created_at is NULL")
rake中止!
Sta
我们正在3.2.9版本的rails引擎上工作。引擎通过以下方式生成:
rails plugin new rails_engine -mountable --skip-test-unit --dummy-path=spec/dummy
在初始设置后,我们可以生成一个模型,就像我们在常规rails应用程序中所做的那样:
rails g model post name:string
在db/migrate/下创建了一个迁移文件。接下来,我们在/ rails_engine目录下执行了db:migrate:
rake db:migrate
它会导致错误:
Don't know how to bu
我已经升级到了rails 2.3.11和ruby 1.9.2,因为我的一些gem与以前的版本不兼容。现在我无法执行rake命令。当我使用rake gems时,我得到了以下错误:install or rake db:migrate。
(in C:/Ruby/New/Facebook)
rake aborted!
can't convert Symbol into Integer
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53:
in `[]'
C:/Ruby192/li
因为我迁移到了Snow Leopard,所以我不能从命令行运行任何Rake命令。
例如,如果我尝试运行rake stats,我会得到:
rake aborted!
dlopen(/Users/xxx/.gem/ruby/1.8/gems/hpricot-0.8.1/lib/hpricot_scan.bundle, 9): no suitable image found. Did find:
/Users/xxx/.gem/ruby/1.8/gems/hpricot-0.8.1/lib/hpricot_scan.bundle: no matching architecture in u
我正在尝试使用MongoDB作为我的数据库来构建一个基于Roda的(非Rails) API。我安装了Mongoid并配置了连接。不幸的是,当我试图使用rake db:mongoid:create_indexes创建定义的索引时,由于缺少environment 1,任务失败了。在我的Rakefile中应该做什么/包括什么来提供所需的任务?
回溯:
rake aborted!
Don't know how to build task 'environment' (See the list of available tasks with `rake --tasks`)
/ho
当我在Ubuntu终端中运行rake db:migrate时,我一直收到以下错误:
rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.
我在stackoverflow上看到一个解决这个问题的方法是运行:
bundle update rake
所以我这样做,我得到了:
Fetching gem metadata from https://rubygems.org/.......
Fetching g