I am using:
gem 'ajaxful_rating', :git => "git://github.com/helloenvoy/ajaxful-rating", :branch => "rails4".
When I try to call method rating_for, throwing an error:
uninitialized constant ActionController::RecordIdentifier
What verison of Rails are you using? The ActionController::RecordIdentifier was (re)moved to ActionView in Rails 4.1 and should be now used as a ActionView::RecordIdentifier.
http://edgeapi.rubyonrails.org/classes/ActionController/RecordIdentifier.html
So if you are using more recent version, you should change this line in the gem https://github.com/edgarjs/ajaxful-rating/blob/b223cba94702aa0229d084f8de976c0284ac4f36/lib/axr/stars_builder.rb#L48.
Related
Hey there and Merry Xmas,
I would like to add the DDMathParser to my Swift 3 project using the latest CocoaPods version. The problem is I only get DDMathParser 2.0.0 installed. What do I miss?
my podfile is:
platform :osx, '10.11'
target 'DDTest02' do
use_frameworks!
pod 'DDMathParser', :git => 'https://github.com/davedelong/DDMathParser.git'
When I try using:
pod 'DDMathParser', :git => 'https://github.com/davedelong/DDMathParser.git', :branch => 'swift-3.0'
It throws an error warning: Could not find remote branch swift-3.0 to clone.
fatal: Remote branch swift-3.0 not found in upstream origin
DDMathParser author here...
There is no swift-3.0 branch, so I'm not sure why you're trying that. Try specifying the 3.0.0 tag using:
pod 'DDMathParser', :git => 'https://github.com/davedelong/DDMathParser.git', :tag ⇒ '3.0.0'
I am totally lost on this one. I'm using ruby 2.2.4 and upgrading an app from rails 4.1.0 to 4.2. The app was working fine. I changed my Gemfile to use:
gem 'rails', '~>4.2'
Then ran my spec tests and the app blew up with this error:
usr/local/rvm/rubies/ruby-2.2.4/bin/ruby -I/path-to-my-app/vendor/bundle/ruby/2.2.0/gems/rspec-core-3.5.0/lib:/path-to-my-app/vendor/bundle/ruby/2.2.0/gems/rspec-support-3.5.0/lib /path-to-my-app/vendor/bundle/ruby/2.2.0/gems/rspec-core-3.5.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Coverage report generated for RSpec to /path-to-my-app/coverage. 22 / 1206 LOC (1.82%) covered.
/path-to-my-app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/time_zone_conversion.rb:64:in `create_time_zone_conversion_attribute?': undefined method `type' for "NUMBER(38)":String (NoMethodError)
from /path-to-my-app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/time_zone_conversion.rb:53:in `block (2 levels) in inherited'
When I try to load the app in a browser I get an error:
undefined method 'type' for "NUMBER(38)":String
I Google'd on this and found one post. It was here in StackOverflow: NoMethodError: Undefined method 'type' for nil:NilClass in Rails, which led me to: https://gist.github.com/alsemyonov/88826/revisions
I tried the fix posted in the github app, but I still get the same error.
A mention of 'time_zone_conversion.rb' in the error and something I read made me think this was :datetime related. I have one method in a couple of models that works on the date field "updated_at". Not sure if this is related or not.
def updated_at_formatted
self.updated_at.strftime("%m/%d/%Y")
end
I'm also using the gem 'american_date'.
Any ideas on what is causing this and how to fix it would be greatly appreciated.
Thanks,
Found it:
Oracle enhanced adapter version 1.6 just supports Rails 4.2 and does not support Rails 4.1 or lower version of Rails.
When using Ruby on Rails version 4.2 then in Gemfile include
gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
A co-worker and I stepped through the stacktrace on the error. He felt that the line:
undefined method 'type' for "NUMBER(38)":String
was somehow tied to a database issue, which for this app is Oracle. Googling on issues on the Rails 4.2 upgrade and the above oracle gem led us to the above answer.
I have an application that runs fine under Rails 2.3.2.
I'm trying to upgrade it to Rails 4.0, using nginx and unicorn.
My config/environment.rb has these lines that don't work:
Rails::Initializer.run do |config|
config.load_paths += %W( #{RAILS_ROOT}/vendor/gems/ #{RAILS_ROOT}/app/exceptions/ )
config.action_controller.session = { :session_key => "my_app", :secret => "c4c6eee57d9af4f2e1a9c56a49d974b7" }
config.gem "mocha", :version => '>=0.9.4'
The error message I get in unicorn.log is
ERROR -- : uninitialized constant Rails (NameError)
/home/art/config/environment.rb:70:in `<top (required)>'
and line 70 is the " Rails::Initializer.run do |config|" line above.
I guess these things have been moved out into some initializer file somewhere?
I guess bundler now handle gem versions, so I should just move the "config.gem... :version ..." lines into my Gemfile?
And where should I set session_key?
Thanks for any advice.
in the new Rails require the application.rb file:
# Load the Rails application.
require File.expand_path('../application', __FILE__)
In the application.rb require rails:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
usually the session_key is in a new initializer (under initializers folder - look here)
anyway try to run rake rails:update it might help you change some stuff,
or create new rails project and start to copy things from there.
I'm using Rails 4 + prawn_rails + the latest version of prawn (v 1.1.0) and I noticed in the changelog here: https://github.com/prawnpdf/prawn/wiki/CHANGELOG that tables are now separated.
I followed the instructions to require "prawn/tables". I did this by adding a file in my lib directory:
lib/prawn.rb
require "prawn/tables"
I restarted my rails server and I still get the error:
NoMethodError - undefined method `table' for #<Prawn::Document:0x007fda2d594a98>:
How do I fix this?
You should add these lines into your Gemfile.
gem 'prawn', '~> 1.2.1'
gem 'prawn-table', '~> 0.1.0'
The line in the documentation is WRONG. add require 'prawn/table'
to your .pdf.prawn file on the top and it will work.
I have included the simple_captcha gem as instructed on their site:
gem 'simple_captcha', :git => 'git://github.com/galetahub/simple-captcha.git'
I have then run bundler to install it.
Finally when I go to run the following command I get an error:
rails generate simple_captcha
.rvm/gems/ruby-1.9.3-p327#eapi4/bundler/gems/simple-captcha-e99cc7e8bf6b/lib/simple_captcha/form_builder.rb:7:in `included': uninitialized constant Sprockets::Helpers (NameError)
I've searched on the web and can't find any other users with this problem.
Any help appreciated
They say in this pull request that the plugin doesn't support rails 4, You can download their branch and try it out.
Looking at the diff it shows your problem
- base.send(:include, Sprockets::Helpers::RailsHelper)
- base.send(:include, Sprockets::Helpers::IsolatedHelper)
+ base.send(:include, Sprockets::Rails::Helper)
https://github.com/galetahub/simple-captcha/pull/39/files
you could this as the previous version of simple_captcha is not supported on rails 3.
Azdaroth forked of simple_captcha
gem 'simple_captcha', :git => 'git://github.com/Azdaroth/simple-captcha.git', :branch => 'rails-4'