Sauron Sauron - 5 months ago 36
Ruby Question

Cannot run rails server -- `require``main`

On mac, when running:

rails server
, the error below appears:

/Users/KimiebiAkah/Desktop/Rails_App/feastonline/config/application.rb:12:in `require': cannot load such file -- iconv (LoadError)
from /Users/KimiebiAkah/Desktop/Rails_App/feastonline/config/application.rb:12:in `<top (required)>'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/KimiebiAkah/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'


I do not know what is wrong with the app.
How can this be alleviated?

gemfile:

source 'http://rubygems.org'
ruby '2.3.0' # '1.9.3'

gem 'rails', '4.2.6'
gem 'mysql2', '0.4.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'geocoder', '1.1.8'
gem 'nested_form', '0.3.2'
gem 'utf8-cleaner', '0.0.6'
gem 'sprockets', '2.11.0'
gem 'json', '1.8.3'
gem 'ffi'

gem 'chosen-rails', '1.0.1'
gem 'compass-rails', github: 'Compass/compass-rails'

# For image uploads
gem 'carrierwave', '0.9.0'

# For uploading CSV
gem 'roo', '1.13.2'

# DataTables
gem 'jquery-datatables-rails', '2.2.3' # git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-ui-rails', '5.0.2'

# Editing in line:
gem 'best_in_place', '3.0.3'

# Passing data from controller to coffeescript
gem 'gon', '5.2.3'

gem 'progress_bar', '1.0.0'

# Calendar Date and Validation
gem 'bootstrap-datepicker-rails'

# For Google Maps overlays
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails', '~> 1.7.0'

group :development, :test do
gem 'rspec-rails', '2.13.1'
gem 'guard-rspec', '2.5.0'
gem 'spork-rails', '4.0.0'
gem 'childprocess', '0.3.9'
gem 'guard-spork', '1.5.0'
end

group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '3.1.2'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
gem 'sdoc', '0.3.20', require: false
end

gem 'rails_12factor', '0.0.3'

Answer

It shows that the iconv not exist. I guess that you are missing gem "iconv", "~> 1.0.3".

Add this gem "iconv", "~> 1.0.3" to your Gemfile and run bundle install

Comments