0
votes

Ruby on Rails newbie, learning the framework :-) I am trying to set up dev environment and get to welcome aboard page (default Rails server page) in localhost:3000.

Environment details:
(RVM managed) Ruby 2.2.2 and 2.2.3 on OSX

But tried only on Ruby 2.2.2. Installed Rails by creating a new project folder (does not have any special characters) and a Gemfile with below entries

source 'https://rubygems.org'
gem 'rails', github:'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'rack', github: 'rack/rack'
gem 'sass-rails', github: 'rails/sass-rails'
gem 'sprockets',  github: 'rails/sprockets'
gem 'sprockets-rails', '3.0.0.beta2'

bundle install command was successful (verified rails -v showed Rails 5.0.0 alpha)

issued rails new . command and replaced the existing Gemfile (got an error that unable to install Rails5.0.0 I guess Rails5.0.0 is not available as a Gem) so manually updated the Gemfile, now it looks like below

source 'https://rubygems.org'
gem 'rails', github:'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'rack', github: 'rack/rack'
gem 'sass-rails', github: 'rails/sass-rails'
gem 'sprockets',  github: 'rails/sprockets'
gem 'sprockets-rails', '3.0.0.beta2'
gem 'sqlite3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'

group :development, :test do
  gem 'byebug'
end

group :development do
  gem 'web-console', '~> 2.0'

  gem 'spring'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Issued bundle update command and verified that rails -v shows Rails 5.0.0 alpha.

If I start rails server using rails server and hit http://localhost:3000/ I see something went wrong error page and the server logs does not show any useful messages :(

rails s
=> Booting WEBrick
=> Rails 5.0.0.alpha application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-09-15 22:20:37] INFO  WEBrick 1.3.1
[2015-09-15 22:20:37] INFO  ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
[2015-09-15 22:20:37] INFO  WEBrick::HTTPServer#start: pid=69775 port=3000
DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from block (3 levels) in <class:Engine> at /Users/manikandanviswanathan/.rvm/gems/ruby-2.2.2@Rails5/gems/turbolinks-2.5.3/lib/turbolinks.rb:14)
DEPRECATION WARNING: after_filter is deprecated and will be removed in Rails 5.1. Use after_action instead. (called from block (3 levels) in <class:Engine> at /Users/manikandanviswanathan/.rvm/gems/ruby-2.2.2@Rails5/gems/turbolinks-2.5.3/lib/turbolinks.rb:15)


Started GET "/" for ::1 at 2015-09-15 22:20:39 -0700

On a side note Rails4.2.2 is working well in my machine ! any help/advice is much appreciated.

Thanks !

1
if you're just learning the framework, for the love of everything sacred, please don't use an alpha version! Use the latest released version of the framework, Rails 4.2! - sevenseacat
@sevenseacat : I agree with you .. I have working project in 4.2.2 but by a plural sight tutorial I came to know about Rails 5.0.0 alpha and for past two days I am curious as why it wont work :( and for the instructor it worked like a charm ! - ManiVI
Maybe try removing/restarting spring, or using thin as your webserver. Need more info than "something went wrong"... - Brad Werth
By console, I meant rails c instead of rails s. Sometimes, if there is an elusive error while running the server it will come up right away when starting the console. Who knows, you might get lucky... - Brad Werth
You don't start the server from within the console, it is its own thing - guides.rubyonrails.org/command_line.html#rails-console - Brad Werth

1 Answers

1
votes

Lessons learnt:

  1. Don`t start learning anything in alpha version - there is a reason they version it in alpha version.
  2. Unless you are not fixing the bugs in alpha version - its better not to seek advice

So As per @sevenseacat`s advice I dropped the idea of learning in Rails alpha version. I installed current stable version rails 4.2.4 and started developing tutorial app.

At this point I do not understand what @huan-son recommendation about precompiling assets - but I have reserved it for future to research more on it.

@all : Thanks a lot for the help/advice. Much appreciated.