I'm new to Ruby on Rails, and am trying to set up a basic, local web server in order to dive into all the framework has to offer. I've installed rails using
gem install rails
and have everything seeming to work. However, I also downloaded rails 5.0.0.rc1. When I call to boot up the server with
rails s
or
bin/rails server
it just ends up with a blank screen on http://localhost:3000. Does this have anything to do with the installation of rails 5.0.0.rc1? Why am I just getting a blank screen and not the default information page which signals that it is working?
Related
I'm building a react-rails app with rails 5.2.
react-rails-hot-loader is not compatible with rails 5.2, the live reloding would work with react_on_rails and I am trying to understand how to configure webpacker to live-reload
I had a read at the following issue
I run ./bin/webpack-dev-server --inline=false and my rails s in a separate terminal instance, but I can not display the site on webpacker localhost:3035/movies. The output in the browser is Cannot GET /movies
I just created the repository, do not know webpacker and would really appreciate any input.
webpacker 3.3.5 supports hot reloading
running ./bin/webpack-dev-server and rails s in a different terminal allows you to use hot reloading features
My understanding is that webpacker development server will provide the js, css and image assets to the rails server.
The application is available at localhost:3000 (from the rails server) for development with hot reloading. I started the webpacker dev server before my rails s
Some more article explains more in details how to configure the webpacker server
https://medium.com/statuscode/introducing-webpacker-7136d66cddfb
https://medium.com/rubyinside/hot-module-reloading-with-webpacker-b663643a60b1https://github.com/justisb/react_on_rails/blob/master/docs/additional-reading/hot-reloading-rails-development.md
https://learnetto.com/tutorials/hot-module-replacement
I am new to the rails programming. I was building my first rails application.
In internet I was searched how to run the rails application in rails 2.3.14 version. But I did not get the answer.
I know how to start the server. But I don't know how run the rails application.
Can anyone please explain me how to run the rails application in 2.3.14 version.
You start a server in Rails 2.3 with:
./script/server start
That starts a local server in development mode, browse to http://localhost:3000 to see your application.
You might want to have a look at the other scripts in the scripts folder too, you will find a subset of modern rails commands. Like
./script/console
to open the Rails console.
But I wouldn't recommend to learn Rails with a 2.3 application. 2.3 has many differences to modern Rails 4.2 or 5.0 application.
I've been trying to get my Rails application to work TorqueBox and one of its requirements is to use JRuby as the Ruby language variant. I've installed JRuby 1.6.6 and the gemfile seems to bundle itself properly, but when the rails server is booted up and accessed within a browser (at localhost:3000 or 0.0.0.0:3000) then the webpage hangs...
I'm not sure if this is a problem with Rails 3.2 and the rails server does start fine (doesn't show any errors within the console) and the Rails 3.2 instance does work with Ruby 1.9.2. So I think it may be something with my gem file list or perhaps something within an initializer.
Any ideas if this is a common problem?
--- EDIT ---
I'm trying to access 0.0.0.0:3000 from WebBrick.
As far as I know torquebox 2.0 beta 3 is currently tested with jruby 1.6.5.1. Maybe try switching to that jruby version. Also make sure you're running ruby in 1.9 mode. To do that, create a torquebox.yml file in your rails config folder and put the below in it:
ruby:
version: 1.9
My client wants me to download a working ruby on rails project to my local system. But when I connected to a server, I got nine identical project folders (which seem like different versions). Is there a way to know which project is running using process id (I have only the process id)?
If you have the process ID, then check /proc/[pid]/cwd symbolic link. This is the process' current directory.
I assume that you are on a Linux-like system.
If you are not, then you may issue a HTTP request (to wake up the rails app) and then look which logfile has been modified recently.
if you are able to run rails console on your server then type this: Rails.root in your console or irb it will tell that project you are on belongs to which directory!
no we cant know using process id. but when you start server you will find rails version like
:> ruby script/server
=> Booting Mongrel
=> Rails 2.3.10 application starting on http://0.0.0.0:3000
above line using rails 2.3.10 version and if you want to know ruby version simply call
ruby -v in your command prompt
Ok, I'm a noob with rails... so I just set up rails with RVM and created a new project, and when I try to visit a newly created view I'm getting an error 500.
Heres my setup:
OSX 10.6.5
Installed MySQL 64bit
RVM installed ruby 1.8.7 and rails 2.3.8 (no other rails or ruby except for the system ruby) rvm install 1.8.7, rvm use --create 1.8.7#rails2, gem install rails -v=2.3.8
Passenger with Apache gem install passenger, rvmsudo passenger-install-apache2-module
Passenger preference pane
Turned on websharing
I then proceeded to setup a rails project in my development folder called testapp, added it in the passenger preference pane, and then ran script/generate controller Say, defined an action hello, and then created a view in the app/view/say folder called hello.
Now I'm getting a 500 error when visiting myapp.local/say/hello, what am i doing wrong?
UPDATE:
I checked the logs and also tried running using WEBrick instead of passenger and apache. I got thrown back the same errors. I don't think I should post the entire log, should I? But the first error is
no such file to load -- sqlite3
I have not yet setup a db, I was going to use mysql, but I didn't want to install it since I'm not using models yet. Is it a requirement?
UPDATE 2:
So I installed the mysql gem with gem install mysql -- --include=/usr/local/lib (not sure if this is right). I then created a rails app with rails -d mysql myapp. And set the password in the database.yml. I'm getting a new error now:
Unknown database 'myapp_development'
So I have to create a database. Why am I being forced to create a db at all?
Yeah, you need to install sqlite even if you're not using models yet - Rails checks to make sure whatever is specified in database.yml is actually there to use.
Don't access it through passenger, launch it using ruby script/server and check out the error it throws there. Generally those errors are way more descriptive than Passenger because Passenger is probably running your application using the production environment.
Hey Ryan, do you need to Ruby 1.8.7? Why don't you install the latest 1.9.2 and Rails 3? I have the same environment and so far no problems. Here is a link for installing everything you need. Let me know if it helped! http://amerine.net/2010/02/24/rvm-rails3-ruby-1-9-2-setup.html
Salud!