I have ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32] and rails 5.1.4. I am getting following error when i run rails s command.
rails s
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- bcrypt_ext (LoadError)
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `block (2 levels) in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `block in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in `require'
from E:/Rauf Personal Data/work/rails/shine/config/application.rb:7:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `block in perform'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have almost tried every solution but i am unable to resolve this issue. Can any body please help me to sort out this issue. I already tried following:
Firstly uninstall bcrypt and bcrypt-ruby by running these two commands:
gem uninstall bcrypt and gem uninstall bcrypt-ruby
Install it again with gem install bcrypt --platform=ruby
In your Gemfile write gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'
Run bundle install
I have managed to solve this issue by adding following line in the Gemfile....
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
After trying several methods, the above worked for me:
1) Stop all rails servers.
2) Add : gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt' to the gemfile.
3) bundle install.
Related
I am on Windows 7 64 bit, and I am running Ruby 2.3.3 and Rails 5.1.2. I am coming across this error with my RoR project when attempting to create a new user on my website:
"LoadError in Devise::RegistrationsController#create" "cannot load
such file -- bcrypt_ext"
I have come across this and similar solutions through Google searching:
"Firstly uninstall bcrypt and bcrypt-ruby by running these two
commands: gem uninstall bcrypt and gem uninstall bcrypt-ruby Install
it again with gem install bcrypt --platform=ruby In your Gemfile write
gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt' Run bundle install"
However, when I attempt to run gem uninstall bcrypt in my console I receive this error message:
"$ gem uninstall bcrypt ERROR: While executing gem ...
(Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)"
I believe this is due to my Devise gem. When I run gem list bcrypt in console I receive this output:
"bcrypt (3.1.11 x86-mingw32)"
My rails app came with this line commented out in my gem file:
"# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.11'"
I have tried uncommenting it back into the code, and when I do so the Rails Server fails to load and lists this error in console:
C:\Users\James\Desktop\rails_app>rails s
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/act
ive_support/dependencies.rb:292:in `require': cannot load such file -- bcrypt_ex
t (LoadError)
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-
5.1.3/lib/active_support/dependencies.rb:292:in `block in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-
5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-
5.1.3/lib/active_support/dependencies.rb:292:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-
x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-
x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:82:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:77:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:77:in `block in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:66:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler/runtime.rb:66:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2
/lib/bundler.rb:108:in `require'
from C:/Users/James/Desktop/rails_app/config/application.rb:7:in `<top (
required)>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/commands/server/server_command.rb:129:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/commands/server/server_command.rb:129:in `block in perform'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/commands/server/server_command.rb:126:in `tap'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/commands/server/server_command.rb:126:in `perform'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li
b/thor/command.rb:27:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li
b/thor/invocation.rb:126:in `invoke_command'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li
b/thor.rb:369:in `dispatch'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/command/base.rb:63:in `perform'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/command.rb:44:in `invoke'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3
/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
At this point, I'm out of ideas. Please advise. Thank you.
You should uninstall bcrypt-ruby before uninstalling bcrypt, as this is the dependent gem.
This can be done as so:
gem uninstall bcrypt-ruby
gem uninstall bcrypt
gem install bcrypt --platform=ruby
try the following steps which worked for me:
remove anything related to brypt from you Gemfile
Enter the following information into your Gemfile
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
Run 'bundle install' at the root of your project and it should work.
For some reason when you point it to the git page it worked for me.
I've just created a fresh Rails 5 application. I don't have any MVC's generated yet inside my application.
I added some gems to the gem file including gem 'bcrypt', '3.1.11'.
When I try to create a controller with the rails generator, I get an error.
This is the command with the error that I got:
command>rails generate controller StaticPages home help
C:/Ruby23/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (LoadError)
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from C:/Users/Doesha/Desktop/rails17/rails_sample_app/config/application.rb:7:in `<top (required)>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require_application_and_environment!'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:143:in `generate_or_destroy'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:60:in `generate'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
All I did was add gems to my gemfile, so I'm not sure why the rails generator isn't working.
I did notice that my generator stops working when I add the gem bcrypt.
Can someone tell me the reason I can't use my generator once I installed gem 'bcrypt', '3.1.11'?
delete gem 'bcrypt', '3.1.11' from gem file and
use
$gem install bcrypt
This error comes every time I type rails generate :
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.4.2/lib/mysql2.rb:31:in
`require':
dlopen(/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle,
9): Library not loaded: libmysqlclient.18.dylib Referenced from:
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle
Reason: image not found -
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle
(LoadError) from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.4.2/lib/mysql2.rb:31:in
`<top (required)>' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in
`require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in
`block (2 levels) in require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in
`each' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in
`block in require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in
`each' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in
`require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:99:in
`require' from
/Users/hadifarhat/simple_cms/config/application.rb:7:in `<top
(required)>' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:82:in
`require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:82:in
`preload' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:143:in
`serve' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:131:in
`block in run' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:125:in
`loop' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application.rb:125:in
`run' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.1/lib/spring/application/boot.rb:18:in
`<top (required)>' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require' from
/Users/hadifarhat/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require' from -e:1:in `<main>'
insert into your GemFile
gem 'mysql2', '~> 0.3.18'
install some mysql2 dependency
sudo apt-get install libmysql-ruby libmysqlclient-dev
then bundle install
bundle install
Add into your GemFile
gem 'mysql2' #For latest version
Then update your bundle
bundle install
Then generate rails into ruby folder
gem install rails
Finally create project
rails new project #Project your project name
Hope will help you
I'm trying to upgrade a very old app from Rails 2.3.12 to Rails 3.0.0 (as a starting point to getting it to Rails 4). I've been slowly going through and fixing anything that has broken since the upgrade by removing old gems etc.
I've got stuck on a problem that I can't seem to pin point or fix.
I'm running Rails3, Ruby1.9.3
When I try to run the rails server I get the following error:
=> Booting WEBrick
=> Rails 3.0.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require': cannot load such file -- activerecord (LoadError)
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/Documents/Work/Saild/saild/vendor/plugins/acts_as_commentable/lib/commentable_methods.rb:1:in `<top (required)>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/Documents/Work/Saild/saild/vendor/plugins/acts_as_commentable/lib/acts_as_commentable.rb:1:in `<top (required)>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/Documents/Work/Saild/saild/vendor/plugins/acts_as_commentable/rails/init.rb:1:in `block in <class:Plugin>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/plugin.rb:81:in `eval'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/plugin.rb:81:in `block in <class:Plugin>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `instance_exec'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `run'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `each'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `run_initializers'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/application.rb:134:in `initialize!'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing'
from /home/camillavk/Documents/Work/Saild/saild/config/environment.rb:7:in `<top (required)>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/camillavk/Documents/Work/Saild/saild/config.ru:3:in `block in <main>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/builder.rb:46:in `instance_eval'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/builder.rb:46:in `initialize'
from /home/camillavk/Documents/Work/Saild/saild/config.ru:1:in `new'
from /home/camillavk/Documents/Work/Saild/saild/config.ru:1:in `<main>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/builder.rb:35:in `eval'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/builder.rb:35:in `parse_file'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/server.rb:162:in `app'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/server.rb:253:in `wrapped_app'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/rack-1.2.8/lib/rack/server.rb:204:in `start'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/commands/server.rb:65:in `start'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/railties-3.0.0/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
My Gemfile looks like this:
source 'https://rubygems.org'
gem "rails", "3.0.0"
gem "airbrake"
gem "aws-s3"
gem "bj"
gem "bundler", "~> 1.0.0"
gem "calendar_date_select", "1.15"
gem "cancan", "1.2.0"
gem "carmen"
gem 'comma', '0.4.1'
gem 'exifr'
# factory_girl 1.2.4 wasn't working with Rails 3 - consider an upgrade to factory_girl_rails?
# gem "factory_girl", "1.2.4"
gem 'fastercsv'
gem "geokit"
gem "haml"
gem "hpricot"
gem 'hoptoad_notifier'
gem "jrails"
gem "libxml-ruby", "2.4.0"
gem "memcached", "~> 1.8.0"
#memcached no longer works?
gem 'dalli'
# Not sure why we have this if we're using SQLite3
gem "mysql2", "~> 0.2.6"
#TODO: changed by almazom
gem "rake", "0.8.4"
gem 'recurly'
gem "rdoc"
gem "rmagick"
gem "rspreedly"
gem "rubyzip"
gem 'sass'
#need to use simplecov when upgrading to ruby 2 as rcov doesn't work
gem "simplecov"
gem 'sqlite3'
# tmail no longer included in rails 3?
gem 'tmail'
gem "will_paginate", "2.3.16"
gem 'yaml_db'
group :development, :test do
gem 'test-unit', '1.2.3'
gem 'rspec', '1.3.2'
gem 'rspec-rails', '~> 1.3.4'
end
group :test do
gem 'capybara', '0.3.5'
gem 'cucumber', '1.1.2'
gem 'cucumber-rails', :git => "git://github.com/RKelln/cucumber-rails.git", :branch => "0.3.2-capybara-fix"
gem 'database_cleaner'
end
Has anyone else encountered this problem before when upgrading to Rails 3? I can't find anything on Google about it....
Or does anyone have a suggestion on how I can find/fix the issue?
Many thanks in advance!
Let's take a look at your stack trace. Stack traces are read top to bottom. If you have function A calling function B calling function C, where an error happens, the stack trace shows
C
B
A
We can see that the first lines all come from Rails itself:
/home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require': cannot load such file -- activerecord (LoadError)
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/camillavk/.rvm/gems/ruby-1.9.3-p551#rails3/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
Since it's usually unlikely that Rails itself is the culprit, we look for the first line that comes from some place else — either your own code, or a third-party library.
The next line is just that:
from /home/camillavk/Documents/Work/Saild/saild/vendor/plugins/acts_as_commentable/lib/commentable_methods.rb:1:in `<top (required)>'
We see that it's code at vendor/plugins, making it an old, Rails 2.3-style plugin. They were deprecated in Rails 3, and completely stopped working in Rails 4. They were replaced by "Gem plugins" that are added through your Gemfile and Bundler, instead of vendor/plugins.
So acts_as_commentable is a good candidate as the culprit. The Github project page shows a version especially for Rails 3, so removing the old plugin and replacing it with that Gem gives you a good shot at fixing this issue.
I used
gem 'rspec-rails', "~> 2.14.2" and all my tests works. Now i installed
gem 'rspec', '~> 3.0.0.beta' and I get this:
henio#henio-Toshiba:~/git/EduWords$ bundle exec rspec
/home/henio/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require': cannot load such file -- rspec/rails (LoadError)
from /home/henio/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
from /home/henio/git/EduWords/spec/spec_helper.rb:4:in `<top (required)>'
from /home/henio/git/EduWords/spec/features/languages_pages_spec.rb:1:in `require'
from /home/henio/git/EduWords/spec/features/languages_pages_spec.rb:1:in `<top (required)>'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/configuration.rb:1051:in `load'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/configuration.rb:1051:in `block in load_spec_files'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/configuration.rb:1051:in `each'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/configuration.rb:1051:in `load_spec_files'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/runner.rb:97:in `setup'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/runner.rb:85:in `run'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/runner.rb:70:in `run'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/lib/rspec/core/runner.rb:38:in `invoke'
from /home/henio/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0.rc1/exe/rspec:4:in `<top (required)>'
from /home/henio/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `load'
from /home/henio/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `<main>'
from /home/henio/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /home/henio/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
I'm using Rails 4.0.3 and Ruby 2.1.1p76. I did bundle install. What I'm doing in wrong way?
If you’re using Rails, you should use rspec-rails to integrate Rails with RSpec. Change your gem requirement to this:
gem 'rspec-rails', '~> 3.0.0.beta'
RSpec 3 introduces significant changes, so you’ll have to update some specs.