在rails升级到版本5.2,ruby升级到2.5.7之后,我在我的rails项目中遇到了下面的错误,我也升级了faraday gem,但无法解决这个问题。任何帮助都是有用的。 NoMethodError: undefined method `prepend' for #<HTTP::Client:0x00007ff4dc21a470> Did you mean? present?
我正致力于将Ruby2.2.2 (Rails 4.1)应用程序升级到Ruby2.5.7 (Rails 5.2),对于一些模型,我遇到了一些错误
从搜索来看,似乎有一些通用的activerecord验证规则/消息?这些信息是:
Status is invalid
User is invalid`
我对Ruby充其量是个新手--因此,任何关于解决这个错误的最佳方法的建议都会受到欢迎!
在将我的应用程序从rails 5.2升级到rails 6之后,我遇到了这个问题
此模型适配器不支持从数据库中获取记录。
class PlayerArtController < ApplicationController
load_and_authorize_resource only: [:index, :create]
def index
end
def create
end
end
版本:
rails (6.0.3.4)
癌病病(2.3.0)
ruby 2.7.2
使用谷歌为Google Ruby2.5标准环境提供的默认app.yaml配置,我在使用Rails时无法成功部署。如果我在本地使用Ruby2.5.5,并且在我的.ruby-version和Gemfile中,部署失败:
Your Ruby version is 2.5.7, but your Gemfile specified 2.5.5.
如果我在本地以及在我的Gemfile和.ruby-version文件中使用Ruby2.5.7,部署就会成功,但是访问应用程序会导致日志中出现以下错误:
bundler: failed to load command: rails (/srv/vendor/bu
我刚刚将ubuntu从11.10升级到12.04,之后当我在rails项目中运行我的服务器时,我得到了这个错误
$ rails s
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require':
libmysqlclient_r.so.16: cannot open shared object file: No such file or directory -
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/mysql2-0
我正在将一个应用程序从Rails 4.2升级到5.2。我遇到了一个问题,在4.2中创建的作业在Rails 5.2下调用时会引发错误。
Delayed::DeserializationError (Job failed to load: not delegated...
在从5.0迁移到5.1之后,我已经将其范围缩小到了一个问题。在5.0.7中没有问题,但在5.1.0中有问题。通过执行YAML.load(yml),我可以在一个简单的测试用例(取自job.handler)上重现,其中yml:
object: !ruby/object:Account
raw_attributes:
id
我在上学习Ruby on Rails教程,一切都很顺利,直到我尝试让我的应用程序在Heroku上运行。
我安装了heroku,它工作得很好,但现在当我运行heroku keys:add或任何其他heroku命令时,我得到以下错误:
/home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:9:in `rescue in <top (required)>':
no such file to load -- net/https. Try runni
全,
在将Ruby升级到2.5.1和Rails版本升级到4.2.5之后,当我尝试启动rails服务器时,我会收到以下消息,它会崩溃。我已经看到了一些关于这个错误的链接,但是这些链接并没有阻止rails服务器的启动。除了升级到5.0.2之外,还有别的方法吗?我的宝石版也是2.7.6。
rails server
=> Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup
我在rails上有一个生产rails应用程序,但是我将我的应用程序更新为Ruby 2.2.5,rails从4.2升级到5.2。当我尝试将它部署到ElasticBeanstalk时,每次都会遇到以下错误:
Warning: the running version of Bundler is older than the version that created the lockfile.
We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby vers
我第一次做这个升级,第一步就面临问题:
基本上,我想升级我的项目的rails版本,所以我更改了rails 5.2的Gemfile并尝试运行:
bundle update rails
作为给定的,但我无法更新包并得到以下错误
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (~> 5.2) was resolved to 5.2.1.rc1, which depends on
activerecord (= 5.2.1.rc1)
我升级到Yosemite,现在当我尝试使用rails new <appname>设置初始rails应用程序时,我收到了一条错误消息:
/Users/****/.rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in“要求”:dlopen(/Users/*****/.rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-darwin13.3.0/openssl.bundle,9):符号未找到:_SSLv2_client_me
我正在尝试将一个非常小的devise应用程序升级到ruby 2和rails 4。当我尝试启动rails服务器或输入db命令时,我得到了一个丢失bcrypt-ruby (devise的依赖项)的错误。
我如何才能强制devise使用更新版本的bcrypt-ruby,该版本位于gemfile (3.1.1)中,而不是自动安装的依赖项(3.0.1)中,因为在gemfile中添加"bcrypt-ruby 3.1.1“并运行包更新/安装似乎不能解决问题。
$ rails s
You have requested:
bcrypt-ruby = 3.1.1
The bundle current
在Rails5.0中,我可以编写一个查询
class DC < ApplicationRecord
has_many :b_elements, through: :c_node
has_many :d_elements, through: :e_node
def both
union = b_elements.union(d_elements)
elements = Element.arel_table
Element.from(elements.create_table_alias(union, :elements))
end
end
当我升级
在我要从Rails 3.2.22.4升级到Rails 4.0.13的应用程序上,以下用于增强全局环境任务的代码块由于不能在目标Rails版本上运行而成为障碍:
Rails.application.class.rake_tasks do
Rake::Task["environment"].enhance do
...
升级到Rails 4.1.1之后,我在访问助手方法时遇到了问题。我的应用程序中有以下代码。
module ApplicationHelper
def last_page_url
session[:last_page]
end
end
class Admin::ArticlesController < ApplicationController
def update
#....more code here
return redirect_to self.last_page_url
end
end
在Rail
我最近将我的rails应用程序更新到了rails 5.2和Ruby版本2.3.3,令我惊讶的是,浏览器中的一个开发错误不再显示为错误,而是显示以下消息
We are sorry, something went wrong If you are the application owner please check logs
同时,
config.consider_all_requests_local = true
存在于我的development.rb文件中。
运行RAILS_ENV=development rails s也无济于事
我所做的所有更改都是按照rails指南进行的。
还有一个类似的
我试图将一个相当大的项目从Rails 5.1.4升级到Rails 5.2 (也将mysql2从0.3.10升级到0.5.1),在使用joins时遇到了一个问题。考虑以下模式:
class TermsVersionApproval < ApplicationRecord
belongs_to :terms_version
end
class TermsVersion < ApplicationRecord
end
当我进行联接时,它会在FROM语句之后省略表名并生成FROM INNER JOIN,从而生成无效的sql。
TermsVersionApproval.joins(:t