我在Rails 3中进行数据库迁移时遇到异常.
undefined method `visitor' for #<ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x00000103dea3d8>
Run Code Online (Sandbox Code Playgroud)
编辑
请在这里查看解决方案.
visitor我的项目中没有出现字符串,所以我很困惑.
这是完整的转储:
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
rake aborted!
undefined method `visitor' for #<ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x00000103dea3d8>
.rvm/gems/ruby-1.9.2-p180/gems/arel-2.1.5/lib/arel/tree_manager.rb:19:in `visitor'
.rvm/gems/ruby-1.9.2-p180/gems/arel-2.1.5/lib/arel/tree_manager.rb:23:in `to_sql'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:562:in `get_all_versions'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:708:in `migrated'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:635:in `current_version'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:652:in `block in migrate'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:652:in `each'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:652:in `detect'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:652:in `migrate'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:545:in `up'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/migration.rb:526:in `migrate'
.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc5/lib/active_record/railties/databases.rake:161:in `block (2 …Run Code Online (Sandbox Code Playgroud) 检查此链接. http://dev.twitter.com/pages/share_bookmarklet
将书签拖到书签栏并单击它.它会打开一个弹出窗口.
为什么我的firefox/ie/chrome没有阻止这个?
谢谢
javascript:
function loadScript(scriptURL) {
var scriptElem = document.createElement('SCRIPT');
scriptElem.setAttribute('language', 'JavaScript');
scriptElem.setAttribute('src', scriptURL);
document.body.appendChild(scriptElem);
}
var url = 'http://api.bit.ly/shorten?version=2.0.1&login=tweetthees&apiKey=Rxyz&longUrl=' + document.location;
var longUrl = document.location;
loadScript(url + '&callback=tweetme');
function tweetme(json) {
var shortLink = json.results[longUrl].shortUrl;
var finalUrl = 'http://twitter.com/home?status=Reading: ' + document.title + ' ' + shortLink;
window.open(finalUrl, "Share link", "width=1024,height=400,location=1,status=1,scrollbars=1");
}
Run Code Online (Sandbox Code Playgroud) 鉴于使用设计管理的用户与"事物"之间的一对多关系,我的目标是绘制如下的宁静路线:
http://host/username
http://host/username/things
http://host/username/things/1
...
Run Code Online (Sandbox Code Playgroud)
我知道Rails路由中的嵌套资源,但我无法弄清楚如何将它应用于通过设计创建和管理的通用用户模型.
gem install 失败并出现以下错误,如何在公共位置指定堆大小配置,以便我不必每次都重新定义它.
Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace.
Run Code Online (Sandbox Code Playgroud) activerecord ×1
bookmarklet ×1
devise ×1
javascript ×1
jruby ×1
popup ×1
routes ×1
ruby ×1
rubygems ×1
window.open ×1