error when running ruby server [closed] - ruby-on-rails

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm fairly new to ruby on rails. Project was working fine I saved and closed the box. when I reopened it and tried running the server I got this:
/home/action/croquet/config/routes.rb:1:in `<top (required)>': undefined local variable or method `rRails' for main:Object (NameError)
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `block in load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /home/action/.rvm/gems/ruby-2.1.3/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/action/croquet/bin/spring:16:in `require'
from /home/action/croquet/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

typing mistake. It should be Rails not rRails.

You have a typo on rRails. It should be Rails.applications.routes.draw

Related

I am unable to start the rails server [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
When I start the Rails server I get the following error:
$ rails s -p 8080
from /home/ccuser/.gem/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /home/ccuser/workspace/learn-rails_threadly/threadly/bin/rails:8:in `require'
from /home/ccuser/workspace/learn-rails_threadly/threadly/bin/rails:8:in `<top (required)>'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `load'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `call'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/client/command.rb:7:in `call'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/client.rb:26:in `run'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/bin/spring:48:in `<top (required)>'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `load'
from /home/ccuser/.gem/ruby/2.0.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/ccuser/workspace/learn-rails_threadly/threadly/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
What could be the problem?
As short hand, "rails s" starts the server as well as "rails server". The space inbetween is required. Also, I would also strongly suggest Rails development on non Windows platforms. A handful of gems are not compatible with windows versions, so loading a virtual machine with ubuntu will help you in the long run for sure.
I started with Rails development on Windows and instantly ran into trouble loading MySQL gems and others so I switched to Ubuntu 14.04 in a VM and it's been fantastic to say the least.
your command is wrong, It's rails server but not railsserver

Rails server couldn't start in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I installed ruby 2.1.0 and rails 4.0.4. I created an application. When I started 'rails server', I got following errors:
/home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/uglifier-2.5.0/lib/uglifier.rb:3:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `each'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `block in require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `each'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.1/lib/bundler.rb:132:in `require'
from /home/chandra/Desktop/webApplication/assignment1/blog/config/application.rb:7:in `<top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:74:in `require'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:74:in `block in <top (required)>'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `tap'
from /home/chandra/.rvm/gems/ruby-2.1.0/gems/railties-4.0.4/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Any suggestion? Thanks.
As the first line says: You need to install a JavaScript runtime library. And you will find further information at the given url: https://github.com/sstephenson/execjs
Install a javascript runtime like node js
if you are using ubuntu then follow the steps to get it install
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Have you tried to put gem 'therubyracer' in your gemfile?

undefined method eager_autoload when trying to start rails server [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
UPDATE: I fixed the error by installing rack-cache gem
I was trying to start a rails server on one of my project and got this error
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.0/lib/action_controller/metal/strong_parameters.rb:105: warning: already initialized constant NEVER_UNPERMITTED_PARAMS
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-4.0.0/lib/action_controller/metal/strong_parameters.rb:105: warning: already initialized constant NEVER_UNPERMITTED_PARAMS
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:3:in `<module:Caching>': undefined method `eager_autoload' for ActionController::Caching:Module (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:2:in `<module:ActionController>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/action_controller/action_caching.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionpack-action_caching-1.1.0/lib/actionpack/action_caching.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /vagrant/captiv8/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I tried to reinstall the actionpack gem but the problem still persist.
try command "bundle exec rails server"

problems in the running the rails server after updating to rails 4 [duplicate]

This question already has answers here:
cannot load railtie after upgrade to rails 4 per ruby.railstutorial.org
(3 answers)
Closed 8 years ago.
I updated my rails from 3 to 4 and ruby to version 2. I tried running rails s after running the updates. What is the error?
/home/aravind/Documents/dev/ptl/config/application.rb:7:in `require': cannot load such file -- active_resource/railtie (LoadError)
from /home/aravind/Documents/dev/ptl/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/lib/ruby/gems/2I .0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
try this:
in aplication.rb comment this line:
require "active_resource/railtie"
if you have it, if not I'll just remove my answer but this fixed my problem a few days ago.

rails openssl issue in fedora 14 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have installed ruby by downloading and compiling the source... when i run script/server in my rails application.. it throws an error
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:271:in `require_frameworks': no such file to load -- openssl (RuntimeError)
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:134:in `process'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from /home/mohit/install/elitmus-campus/config/environment.rb:16
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from script/server:3
when i do yum install openssl.
it shows openssl-1.0.0c-1.fc14.i686 already installed and latest version.
Try yum install openssl-devel

Resources