I have just started learning Ruby on Rails. I installed all the related softwares and started exploring the same. When I try to start the default server in Rails (WEBrick), I am getting the following error.
C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:3:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:7:in `<class:Template>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:6:in `<module:WebConsole>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:1:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from C:/Temp/Rails-Project/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in`require'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in`block in server'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in`tap'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in`server'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in`run_command!'
from C:/Apps/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Upon research in SOF, found from the link and other link that the nokogiri needs to be updated in the Gemfile. I updated and executed the Bundle Install command. Even after that, its not working. Please suggest me the ways to fix it. FYI, I am using the latest versions of gems.
I also updated my Gemfile with
gem 'rack', '~> 1.6.0'
It did not work.
Install an older version of rails (4.0.0) because I think windows doesn't have stable version of rails > 4.0.
Change the version in gemfile.
Related
I'm trying to use the Carrierwave gem to add pictures to my site. As soon as I use the gem uploader, I get the following error telling me that I have an incompatible library version referencing Nokogiri 1.8.1 ...
/Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `require': incompatible library version - /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri/nokogiri.bundle (fatal)
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `rescue in <top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:28:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/sanitize_helper.rb:2:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/sanitize_helper.rb:2:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:32:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:18:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_helper.rb:4:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:50:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/context.rb:1:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/context.rb:1:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:7:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:7:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:14:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:14:in `block in <top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:12:in `each'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:12:in `<top (required)>'
from /Users/danieluribe/code/one_stop_ror/yelpdemo/config/application.rb:3:in `require'
from /Users/danieluribe/code/one_stop_ror/yelpdemo/config/application.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/danieluribe/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/danieluribe/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Most of the solutions I've seen online include references to libxml2 but I see no references in my error to that. I have however tried the solution here with no success.
I have uninstalled and reinstalled both nokogiri and libxml multiple times using brew. I've also used the installation for Nokogiri on Mac as mentioned on their page here.
I'm not 100-percent sure if it's simply a Nokogiri error or whether libxml2 requires a different version than the default. The current version I'm using for libxml2 is 2.9.3. Any help or pointing in the right direction will be greatly appreciated. Let me know if more details are needed.
Try installing the development files if you haven't already:
sudo apt-get install g++ build-essential -y
EDIT: Oops, for mac try this: https://github.com/kennethreitz/osx-gcc-installer
EDIT: Another idea, remove Nokogiri version from the Gemfile then try
gem install nokogiri -v 1.6.8.1 -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.
I am using Windows 7, Ruby 2.2.1, and Rails 4.2.0.
I get the following error after running rails s or bundle exec rails server:
C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri.rb:29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri.rb:29:in `rescue in <top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri.rb:25:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.1/lib/loofah.rb:3:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.1/lib/loofah.rb:3:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.1/lib/rails-html-sanitizer.rb:2:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.1/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/sanitize_helper.rb:3:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/sanitize_helper.rb:3:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_helper.rb:4:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers.rb:3:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/legacy_asset_tag_helper.rb:7:in `<module:LegacyAssetTagHelper>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/legacy_asset_tag_helper.rb:6:in `<module:Rails>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/legacy_asset_tag_helper.rb:4:in `<module:Sprockets>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/legacy_asset_tag_helper.rb:3:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:45:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:45:in `<module:Helper>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:7:in `<module:Rails>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:6:in `<module:Sprockets>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/helper.rb:5:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:6:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:6:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/railtie.rb:2:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/railtie.rb:2:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:11:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:11:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler.rb:134:in `require'
from C:/Users/David/Documents/testapp/config/application.rb:7:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have also run gem list, and these gems are installed. Is it an issue with certain gem versions?
Also, it's 64-bit Windows; could it be in issue with that? I installed the 32 bit, so it should be compatible, right? I will try to uninstall and re-install everything with the 64-bit version of the DevKit and Ruby.
Thanks!
I had a very similar issue just today. I tried to do a new installation of ruby and rails today and I couldn't get "rails server" to work for the exact same reason.
In order to get this to work, you need to run
gem install nokogiri --platform="ruby"
but this fails on Windows because nokogiri doesn't compile properly on Windows.
It's supposed to work with the pre-compiled binary installation that RubyGems pulls down, but I think there's a bug somewhere in RubyGems or nokogiri that's causing this to not work right now, but I'm not sure.
Yeah, so I rolled back to 2.0.0. and it worked. You get "DL is deprecated, please use Fiddle" which I found here, Ruby 2.0.0p0 IRB warning: "DL is deprecated, please use Fiddle", is just a warning. Still switching to Ubuntu soon.
Ruby and rails noob, made a project and got this far. But now I'm getting these errors when trying to run rails server. I'm using Windows vista and ruby 2.0.0.
D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.
rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError)
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/mysql2.rb:2:in `<top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `<top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `block (2 levels) in require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `each'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `block in require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `each'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler.rb:13
2:in `require'
from D:/wamp/www/simple_cms/config/application.rb:7:in `<top (required)>
'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `require'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `block in <top (required)>'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `tap'
from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I know very little about ruby and gems so far but the mysql2 gem seems to be a problem wich I have installed and installed to no help. I do constantly get a message that I have installed the binary version with orders that I've followed. Is this a good or bad thing?
Anyone please help me out, if you need more info just let me know.
I think the answer here is what you are looking for:
stackoverflow.com/a/5368767/1622843
Basically, you need to point the gem to use your mysql instance installed on your machine.
I just meet one uninitialized constanterror,I have no idea on it now.Please save my day.
I'm trying to use mongodb & mysql2 simultaneously.Mongodb was OK.Now I want to add mysql2 gem into my project.
After
gem install mysql2 -- --srcdir=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config and add mysql2 into Gemfile.
When I restart server,it gives me this error:
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:12:in `<class:Client>': uninitialized constant Mysql2::Client::REMEMBER_OPTIONS (NameError)
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:2:in `<module:Mysql2>'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:10:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:10:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
from /Users/Liber/ktv/trunk/config/application.rb:11:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
how Can i fix this guy? thank you.
<class:Client>': uninitialized constant Mysql2::Client::REMEMBER_OPTIONS (NameError)
---------------------------Solution----------------------------
Just
brew install mysql
DO NOT use DMG file to install mysql
and then :
sudo gem install mysql2 --with-mysql-config=/usr/local/mysql/bin/mysql_config
Everything is OK now.
Thanks #BenjaminTan
You should check out this link, which outlines nicely how to setup MySQL on Mountain Lion. The main takeway is to rely on brew install rather than the dmg file, as the OP has mentioned.