ruby on rails tutorial - rails server issue -
i've started doing "ruby on rails tutorial", michael hartl. i've created new project with:
rails new first_app
then had me change gemfile
from:
source 'https://rubygems.org' # use sqlite3 database active record gem 'sqlite3' # use scss stylesheets gem 'sass-rails', '~> 4.0.1' # use uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # use coffeescript .js.coffee assets , views gem 'coffee-rails', '~> 4.0.0' # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby # use jquery javascript library gem 'jquery-rails' # turbolinks makes following links in web application faster. # read more: https://github.com/rails/turbolinks gem 'turbolinks' # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 1.0.1' group :doc # bundle exec rake doc:rails generates api under doc/api. gem 'sdoc', require: false end # use activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.1.2' # use unicorn app server # gem 'unicorn' # use capistrano deployment # gem 'capistrano', group: :development # use debugger # gem 'debugger', group: [:development, :test]
to this:
source 'https://rubygems.org' ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.5' group :development gem 'sqlite3', '1.3.8' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'jbuilder', '1.0.2' group :doc gem 'sdoc', '0.3.20', require: false end
now when try run rails server
, error:
ps c:\users\thomas\rails_projects\first_app> rails server => booting webrick => rails 4.0.5 application starting in development on http://0.0.0.0:3000 => run `rails server -h` more startup options => ctrl-c shutdown server exiting c:/users/thomas/rails_projects/first_app/config/environments/development.rb:1:in `<top (required)>': undefined method `c onfigure' #<firstapp::application:0x2a2bae8> (nomethoderror) c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb :229:in `require' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb :229:in `block in require' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb :214:in `load_dependency' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb :229:in `require' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/engine.rb:591:in `block (2 le vels) in <class:engine>' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `each' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `block in <c lass:engine>' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `insta nce_exec' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `run' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:55:in `block in run_initializers' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_com ponent' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:210:in `block (2 levels) in each_strongly_connected_com ponent_from' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:209:in `block in each_strongly_connected_component_from ' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `each' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `tsort _each_child' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:203:in `each_strongly_connected_component_from' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component' c:/railsinstaller/ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/initializable.rb:54:in `run_i nitializers' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/application.rb:215:in `initia lize!' c:/users/thomas/rails_projects/first_app/config/environment.rb:5:in `<top (required)>' c:/users/thomas/rails_projects/first_app/config.ru:3:in `require' c:/users/thomas/rails_projects/first_app/config.ru:3:in `block in <main>' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' c:/users/thomas/rails_projects/first_app/config.ru:in `new' c:/users/thomas/rails_projects/first_app/config.ru:in `<main>' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_op tions_from_config' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/commands/server.rb:48:in `app ' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/commands/server.rb:75:in `sta rt' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/commands.rb:76:in `block in < top (required)>' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5/lib/rails/commands.rb:71:in `<top (requ ired)>' bin/rails:4:in `require' bin/rails:4:in `<main>'
i know error occurs changing gemfile
because works before change it. want follow michael closely possible. different i'm using ruby 1.9.3 , using ruby 2.0, though in book said if not using 2 change in gemfile
did.
you declaring ruby '2.0.0' @ begin of gemfile using 1.9.3 fail when trying detect it. change ruby '1.9.3'
also might need run bundle in order install gems.
Comments
Post a Comment