So i made a bit of a mistake when trying to add ckeditor to my Rails project last night.
I was following a tutorial and it came to a point in the installation of this gem where it told me to input the following command:
rails generate ckeditor:install --orm=active_record --backend=carrierwave
except i misspelled 'record'
I've looked everywhere i can think and i cant seem to fix this, rails d ... doesnt work gem uninstall doesnt fix it either, and i can't see any related files in my db folder, or anywhere else that i know to look at.
heres the first bit of the error i keep seeing:
/home/naazarik/.rvm/gems/ruby-2.3.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- ckeditor/orm/active_recort (LoadError)
from /home/naazarik/.rvm/gems/ruby-2.3.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
notice the misspelled active_recort?
anyways does anyone have any idea how to either fix this, or remove this from my project?
Thanks!
CKEditor installer should generate config/initializers/ckeditor.rb file that in your case will have following line: require 'ckeditor/orm/active_recort', which you can update to say active_record instead
However, ActiveRecord integration requires a few more files to be generated (and these files were not generated due to a misspelling). Because of that I believe the best way to fix the problem is just to remove the initializer file entirely and run the rails generate ckeditor:install command again.
Related
I'm having the same issue as this link but none of the solutions here are working. A couple hours of searching and of course reading the main Rails Engine docs have all turned up the same strategies as the SO link. I'm wondering if there is something different about the way Rails 5 handles dependencies.
I have this dependency in my gemspec:
s.add_development_dependency "pg_search"
I have this line in my engine.rb file:
require "pg_search"
When I run rails s from within the engine's directory, everything loads fine. When I mount the engine and try to start the server from the rails app directory, I get this error:
/home/andy/.rvm/gems/ruby-2.3.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- pg_search (LoadError).
Finally, if I add the pg_search gem to the Gemfile of the app that is mounting the engine, the rails server starts. This of course isn't a solution, I'm just trying to provide complete information.
This happened because I used 'add_development_dependency' rather than 'add_dependency'.
I am trying to use Rspec for my test. When I run
$ rspec mytest_spec.rb
I get the following error due to the
/home/bastien/.merbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rails_helper (LoadError)
I have tried many things and somehow if I run
rspec spec
or
bundle exec rspec
from the folder where my .rspec file is I do not get any error. I have created an app just to dry test this issue (I created a new rail app, added rspec in my Gemfile, run the bundle install command and the rspec:install command, generated a scaffold and run the tests. Could anyone explain to me why I get this issue and how I can get rid of it? Do I do something wrong when I try to run only one single spec? Thanks.
You are getting that error because you're trying to call your spec like this...
rspec mytest_spec.rb
You need to call it like this from your app's root folder , not inside the spec folder. So first get in the right folder
cd ~/
cd path_to_your_rails_app
Then call your spec
rspec spec/the_rest_of_the_path_to_your_spec/mytest_spec.rb
for instance
rspec spec/models/mytest_spec.rb
For others who find this:
I got this error, 'require': cannot load such file -- rails_helper (LoadError), when I had included the rspec-rails gem but hadn't run rails generate rspec:install which generates the spec/rails_helper.rb file. So if the other solution doesn't help you, make sure you've done that.
For those that the answers above didn't help:
You just need to add gem 'rexml' to your Gemfile.rb, run bundle install and try again.
I'm trying to get PartyFoul set up on a Rails project I collaborate on and am running into a weird issue when I run the install generator.
~/.rvm/gems/.../party_foul-1.5.4/lib/generators/party_foul/install_generator.rb:21:in `rescue in create_initializer_file': uninitialized constant PartyFoul::InstallGenerator::Octokit (NameError)
from ~/.rvm/gems/.../gems/party_foul-1.5.4/lib/generators/party_foul/install_generator.rb:17:in `create_initializer_file'
The script is having trouble finding the Octokit gem so if I put require 'octokit' at the top of install_generator.rb, everything is happy. The weird part is that I can't replicate this issue on a clean Rails 4 or Rails 3.2 project that simply has PartyFoul installed, so it must be specific to this project, and while I can get the configuration file set up manually, I'd like to figure out what root cause of this problem is.
Any help would be much appreciated, thanks!
I just figured it out, the PartyFoul gem was in the :production group so I'm assuming that Rails was somehow not loading it properly. I replicated the NameError in the clean Rails project after moving the gem to :production, so that seems to be the difference. I'm not sure what the root cause is, any enlightenment would still be appreciated :-).
When trying to run rails 2.3.11 server, I keep running into this: `gem_original_require': no such file to load — geometry.
Let me know if you have any questions about what I’m using or the like; I’m rather new to Rails so I’m not really sure what info to provide you all with.
Here’s a trace of rake gems:install —trace
My bet isn't that you've specified the geometry gem in your Gemfile and another gem (or perhaps you) is trying to load it. I don't know the exact name of this gem so I can't tell you exactly the line to put in your Gemfile, but it looks like this:
gem 'ruby-geometry', '0.2.8'
Ruby 1.8.6, Rails 2.2.2, OS X Tiger
My Test::Unit tests started returning the error below. The relevant line seems to be:
`load_missing_constant':
Expected /Users/ethan/project/mtc/webcalendars/app/models/calendar.rb
to define Calendar (LoadError)
The file mentioned, calendar.rb looks fine. I can't find any errors in it. I tried removing the unit and functional test files for the Calendar model, but that had no effect on the error.
In the browser the application seems to be functioning normally.
Any insights? Can anyone suggest a way to isolate the problem?
Longer excerpt:
$ rake test
(in /Users/ethan/project/mtc/webcalendars)
/usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb"
"test/unit/calendar_event_test.rb" "test/unit/calendar_test.rb" "test/unit/committee_test.rb"
"test/unit/event_test.rb" "test/unit/general_app_mailer_test.rb" "test/unit/location_test.rb"
"test/unit/persistent_login_test.rb" "test/unit/role_test.rb" "test/unit/user_role_test.rb"
"test/unit/user_test.rb"
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:428:in
`load_missing_constant': Expected /Users/ethan/project/mtc/webcalendars/app/models/calendar.rb to define Calendar (LoadError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:89:in `const_missing'
[ ... ]
/usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib
/rake/rake_test_loader.rb"
Errors running test:units and test:functionals!
Ethan,
The only time I've seen this is when I've defined multiple classes in one file. I don't use test:unit too much myself but is it possible that you've defined another class before defining Calendar?
Hope that helps.