The idea is to implement benchmark tests, like it is done in rails-perftest. But I found some problems using it in rails 4.
Could you suggest simple benchmarker gem for rails 4?
there are some gems you can use in your project.
gem 'method_profiler'
gem 'rbench'
gem 'bench_press'
gem 'better-benchmark'
gem 'Tach'
Related
While adding spree_advanced_inventory gem to an existing spree application I am getting the following error.
/usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/dynamic_matchers.rb:26:in
'method_missing': undefined method 'attr_accessible' for
Then I added protected-attributes gem to my gem file, bundle install worked well, but when I tried bundle exec rails g spree_advanced_inventory:install giving me result as
"SPREE doesn't work with protected_attributes gem installed"
spree_advanced_inventory extension is for spree 1.3.2 which was most likely be tested for rails <= 3.x which uses attr_accessible whereas you are using spree 3.0 which uses rails >= 4.x which now supports permitted attributes.
Because of some compatibility issues spree do not support protected_attributes gem hence the error.
Ubuntu 13.10 Terminal
Rails 4.2
Ruby 2.1
nifty-generators (0.4.6)
Command =>
rails generate nifty_layout
result=> Could not find generator 'nifty_layout'. Maybe you meant 'nifty:layout' or 'nifty:config' or 'nifty:scaffold'
Runrails generate --helpfor more options.
Please provide a solution.Thank you
Add this to your gemfile: gem 'nifty-generators', group: :development
Run: bundle install
And then use rails generate nifty:layout
I'm trying to use declarative_authorization gem within my Rails 4 app but after inserting it within my gemfile gem 'declarative_authorization' and run the bundle command I try to install it with the command
rails g authorization:install UserModel=Professional nome email telefone logradouro numero bairro cep cidade estado profissao tutorial_completo plan_id:index status_id:index --create-user --user-belongs-to-role
but I get the error Could not find generator authorization:install.
What am I doing wrong?
Thank you
Make it get the gem straight from the github repo. I had this same problem and I had a version that was before they added the installer. When I made it fetch the gem from github it got a later version and the installer worked
#Gemfile
gem 'declarative_authorization', github: "stffn/declarative_authorization"
I want to set up Spree using the core, backend, and api gems. I've installed Spree 2-2-Stable, successfully ran migrations, seed, and set up the admin user, and rake routes returns the Spree routes provided by the API and Backend gems. I had thought the admin login would be provided by the Backend gem, but none of the controllers in the backend are currently accessible by the application (API controllers work fine).
Spree Setup:
Installed 'spree', '2.2.2', then changed gemfile to include only core, backend, api. Did not include sample data. I would have started working from the default spree gem but was also getting errors there.
Spree.user_class = "Spree::User"
Gemfile:
gem 'rails', '4.0.5'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-2-stable'
gem 'spree_core', '~> 2.2.2'
gem 'spree_backend', '~> 2.2.2'
gem 'spree_api', '~> 2.2.2'
http://localhost:3000/admin/login => uninitialized constant Spree::Admin::UserSessionsController
http://localhost:3000/login => uninitialized constant Spree::UserSessionsController
I've looked for solutions to this issue but the results I've found are dealing with Spree extensions, or deal with much older versions of spree/rails.
Thank you!
The Spree gem(s) need to come before 'spree_auth_devise' in the gemfile. The application is now working using the full spree gem, and I am confident I can move forward using the custom spree gems as well.
Also, user controllers and routes for Spree are set up in this file: https://github.com/spree/spree_auth_devise/blob/master/config/routes.rb
The controllers are also defined in the spree_auth_devise gem.
When deploying to cloud-foundry its advised to change from 'jquery-rails' gem to 'cloudfoundry-jquery-rails'
# For Ruby 1.9 Cloud Foundry requires a tweak to the jquery-rails gem.
# gem 'jquery-rails'
gem 'cloudfoundry-jquery-rails'
so that jquery can seamlessly work with cloudfoundry.
What are those fixes refered to in this that are necessary to make it work on cloud-foundry?
The documentation for this is a little out of date and is in the process of being updated. For Rails 3.1 this may well be the case, but certainly not for 3.2, it should work fine as is.