pulled down a repo from git. For some reason I need to do
./script/rails.rb s
where on the rails 3 ap I started on my box, I can just do the
rails server
can anyone help me set up my environment so I don't have to do this? I'm still trying to figure out what I need to type to do a migration...
I think I've figured this out. The repo you downloaded was from somebody developing on a Windows machine. They have to add the ".rb" extention to script/rails to get it to work right.
Calling rails server is really just an alias for script/rails. But you're getting an error because when you type rails server, script/rails isn't there.
The solution is easy: in your local copy of that project, rename script/rails.rb back to script/rails the way it should be.
Also, rails s and rails server are the same thing - one is just a shortcut.
Related
Not great with Linux environments. Building an app in Ruby on Rails with Cloud9 via AWS. It's Rails 5.1 so using secrets but trying my hand at encrypted secrets.
I went and started the process with the rails secrets:setup no problem
I then started editing the file with the edit:secrets so that it would encrypt properly.
Unfortunately I used a "tab" in the file instead of just spaces. Now when I go back to edit the file, it gives me an error about finding an unaproved yaml character and won't let me edit the file.
I've tried re-runing secrets:setup to try to restart the process but to no avail. Any suggestions? Thank you in advance.
You can just delete the 2 secret files and start again:
config/secrets.yml.key
config/secrets.yml.enc
Downloaded a project from Github and I am having issues getting the rails server to start. I ran the bundle install and am definitely in the right directory, is there anything that I've missed that you're supposed to do?
http://pastebin.com/rjhkQkZk
Run rails server. If there is another error, please provide more information:
Operating System
Rails Version
Log
Make sure you are at the root (directory) of the project you downloaded. And then try this command:
rails s
It would be really nice if we could learn what your log entries say.
In your terminal set the ruby source and go to the Root directory.
hit rails s or rails server
Stupid, stupid noob mistake - it's with sinatra not rails. Sorry to waste your time, guys.
I managed to create my first ROR application, called myapp, locally and I also have created another ROR application on my webfaction server with the same name myapp. My question is every time I run commands "rails generate model" or "rails generate controller", how can I synchronise my local environment with my webfaction server. There seem to be lots of files generated when you run rails commands. Does it mean I have to upload the whole application directory every time I generate something? Kindly suggest with your experience, I'm very new to Rails.
If I were you I would go for Heroku first. It's free and easy and along the way you will learn some about hosting Rails apps.
Getting started with Heroku is a good place to go first https://devcenter.heroku.com/articles/quickstart
Heroku is indeed the easy way out, if you are looking into more "metal" deployment - use Capistrano
I'm pretty new to Rails.
I created a new Rails app: rails new app_name, and ran rails server etc.
But, once I shut down and reopened my machine, I can run neither rails server nor rails console. It says to use the rails new app_name command again, but I just want to restart where I left off the day before.
Any advice is very much appreciated.
I'm guessing your current working directory of your command line is not in your project directory which you created yesterday.
cd some_path/to_my/rails_project
rails server
You must be in the directory that represents your project to do things like launch the server. Otherwise, how does it know what project to launch a server for?
Just make sure you are in the directory of the rails app you created. Sounds like you aren't.
I'm still new to ruby and i'm in the process to learn it, i'm actually using Xampp for php on windows, but i'm stuck at finding a complete package to install a RoR server just like Xampp without any manual work.
Is there any tool out there?
You can try Rails Installer
One of your choices is to use built in mongrel/webrick server which comes with each rails app. Just type $ rails s at the console and you're good to go. Otherwise I don't think it's particularly useful to deploy an app each time you change something.