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
Related
I'm new on Ruby on Rails (actualy I'm new programming in general) and I tried to start a new server for my web app. I followed all the rules that were in the book, installed everything required (I hope I've installed it correctly), but it keeps giving me the following error:
My command ->
C:\Users\Júlia\work\demo>ruby bin/rails server
C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `match?': invalid byte sequence in UTF-8 (ArgumentError)
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `chop_basename'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:374:in `plus'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:354:in `+'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:420:in `join'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:444:in `global_config_file'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:93:in `initialize'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `new'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `settings'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:99:in `configured_bundle_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:95:in `bundle_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:639:in `configure_gem_home_and_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:81:in `configure'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:194:in `definition'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:143:in `setup'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `block in <top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:136:in `with_level'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:88:in `silence'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `<top (required)>'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from C:/Users/Júlia/work/demo/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
I'm so frustrated right now, I keep doing things apparently right but something always has to go wrong! Anyways, I hope someone will be able to help me here :(
You can follow GoRails guide to install RoR on windows it will be much easier.
Here it is: Install Ruby On Rails on Windows 10
Also after installing it you may face some other issues related to your database ( whatever database you use) like you may have installed Postgresql on windows, so when after installing it on WSL you need to kill the one running on the port that WSL will use, and similar issues, all solved across the internet
I pulled official Ruby image from docker hub. Since the official Rails image has been deprecated, I felt like using using my rails development inside a Ruby container. Inside the Ruby container, I did gem install rails --version=5.1.1 . I created a rails app and when I do rails s, it throws the following error. What is the problem? Do i need to install additional dependencies? Is this is a nodejs related issue, which I think is not pre- installed in the Ruby image?
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
:
:
from /home/blog/config/application.rb:7:in `<top (required)>'
:
:
from /usr/local/bundle/gems/railties-5.1.1/lib/rails/command.rb:44:in `invoke'
from /usr/local/bundle/gems/railties-5.1.1/lib/rails/commands.rb:16:in `<top (required)>'
from /home/blog/bin/rails:9:in `require'
from /home/blog/bin/rails:9:in `<top (required)>'
from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
:
:
from /home/blog/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Sorry I can't comment, not enough points, but I can answer.
The gem installs and setup usually happen prior and during the setup of the container. Not afterwards manually like you are attempting to do.
Can you post up your Dockerfile so we can have a look?
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
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?
I'm using Rails 4.0.0, and successfully installed the mysql2 gem yesterday (mysql-0.3.15) using mysql-connector-c-6.1.3.winx64. I created a new Rails project called "simple_cms" using rails new simple_cms -d mysql which worked, and then ran bundle install which was also fine.
When I try to run rails server I get the following errors:
C:\Users\Hans>cd sites
C:\Users\Hans\Sites>cd simple_cms
C:\Users\Hans\Sites\simple_cms>rails server
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:in
`requir e': 126: The specified module could not be found. -
C:/Ruby200-x64/lib/ruby/ge
ms/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.15/mysql2/mysql2.so
(LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb :8:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.rc2/lib/bundler.rb:132:in `require'
from C:/Users/Hans/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/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>'
C:\Users\Hans\Sites\simple_cms>
What can I do about this? By the way, the module it cannot find is in fact there.
28-Mar-2014 After all the problems I had installing and re-installing, I still could not get rails server to run. As I mainly want this installation to learn Ruby on Rails, I have instead installed the Bitnami Ruby stack, which installs everything automatically. This seems to work fine, and I've got Ruby, MySQL and the Apache Web Server working.
I had similar problems configuring the Lynda course on learning Ruby on Rails. I found an additional step that seemed to work for me. Since the error was complaining about the lack of a database in mysql, I created the missing database and that fixed the problem.
Log into mysql as root and prompt for password:
mysql -u root -p
Then:
SHOW DATABASES;
CREATE DATABASE simple_cms_development;
exit;