I'm trying to start the web server for a rails app on a Cloud9 IDE workspace and I'm receiving this error message:
`require': cannot load such file -- rack/handler/server (LoadError)
This is the code that I am running:
rails s -p $PORT -b $IP server
I'm very new to Ruby on Rails so my apologies if this pretty simple.
You're running
$ rails s -p $PORT -b $IP server
when it should just be
$ rails s -p $PORT -b $IP
You probably added an extraneous server because you're used to running rails server, but rails s is just a shorthand for the former.
It looks like the extra argument to rails is causing it to look for a file named server in rack/handler, and when it doesn't find a file it throws an error.
Related
I have tried
rails s -p $PORT -b $IP
I am getting no error but getting the help message each time. I also checked if any other server was running but no other process was running. Even then I tried
killall ruby
but no use.
Help message I am getting
I'm trying to start my first production rails server on DigitalOcean but after
$ rails server — binding=my_Droplet_ip_address
i get this error
Exiting
/home/username/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `require': cannot load such file -- rack/handler/— (LoadError)
from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `try_require'
from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:16:in `get'
from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:290:in `server'
And so on.
App works fine locally and simple rails s on server also works fine.
I have Ubuntu 14.04 server with postgres, nginx and passenger.
I'm a complete newbie to it and I may have missed something important. So tell me if you want me to provide any other info on this matter.
Just try rails s -b 0.0.0.0
And stop previous port 3000 used by rails
To stop previous port. Try this command
Lsof wni -p 3000
If you are running on 3000 port
I'm trying to setup Jekyll on Cloud9 IDE and then run locally but i keep getting a page that says "This webpage is not available".
Following instructions on 'https://rubygems.org/gems/jekyll/versions/3.0.1' and https://jekyllrb.com/, here's what i've done.
Added gem in gemfile (gem 'jekyll', '~> 3.0', '>= 3.0.1').
bundle install
Everthing looks like it installs fine.
gem install jekyll
'Successfully installed jekyll-3.0.1'.
jekyll new blog
'New jekyll site installed in /home/ubuntu/workspace/blog.'.
cd blog
jekyl serve
The page that loads is 'This webpage is not available.'
jekyll serve -p $PORT -b $IP
Same result.
jekyll s -p $PORT -b $IP
Same result.
Normally when i want to run locally i just do "rails s -p $PORT -b $IP".
Not really sure how to get this to work. I'm still kindof new to ruby on rails so apologies if i'm missing something simple here.
Thankyou!
Solved.
Thanks #Matahhir for providing this link in the comments above.
https://docs.c9.io/docs/jekyll
I needed to run,
jekyll serve --host $IP --port $PORT --baseurl ""
Here is a how-to for installing Jekyll on Cloud9:
create a free account on Cloud9 (https://c9.io)
create an empty project (Ubuntu) and follow these steps:
type on the command line: gem install jekyll
create an empty _config.yml file in the root
create a index.md file in the root
type on the command line: jekyll serve --host $IP --port $PORT --baseurl ''
your website is now running 'locally' on Cloud9
The content of your index.md file:
---
title: Home
---
Hello world!
When running rails server on cloud9, I get: No application seems to be running here! I tried removing the workspace, cloning it from a repository on github, and nothing works.
The solution that works for me is:
to start the server, do not simply type
rails s
but instead
rails s -b $IP -p $PORT
I'm running bundle exec thin -p 4000 -e sandbox start 2>&1 and I get:
>> Using rails adapter
It just hangs there and I don't think that my Rails adapter is running. Does thin have a log or something I can see to find out what's going on?
look at this site
http://code.macournoyer.com/thin/doc/classes/Thin/Logging.html
it has the info you need to log the adapter
Turns out I had to use foreman to start things up and running.