Can I use gitlab-rails to create a new rails app? - ruby-on-rails

I have installed gitlab with the omnibus package on a Ubuntu-based machine, on which I'm trying to develop a rails app as well. Since gitlab installs ruby and the rails framework for itself, could I be able to use it to create new rails applications? When I run gitlab-rails new app_name under my home directory I get an error message that reads:
/usr/bin/gitlab-rails error: could not load /opt/gitlab/etc/gitlab-rails/gitlab-rails-rc
Either you are not allowed to read the file, or it does not exist yet.
You can generate it with: sudo gitlab-ctl reconfigure
And when I run sudo gitlab-rails new app_name I get:
Can't initialize a new Rails application within the director of another, please change to a non-Rails directory first.
Type 'rails' for help
I've tried to run this under newly created, empty directories, but keep getting the same message. I assume gitlab-rails tries to create the new app under the gitlab project directory for some reason?

As far as I know, this isn't the purpose of the gitlab-rails command and isn't a supported functionality. It'd be a much better idea to create a new Rails app by just using the Rails gem itself.

Related

why rails server is not working on windows 10

I have created the new rails project and trying to run it without doing any changes. I am using the power shell in windows 10. When I am running the rails s command its not starting the server. Please see attached image. I have highlighted the installed ruby version.
The error is there in the output, you do not have a rails app to start a server for, you can create a new app with:
rails new <name-for-your-app>
Follow along this tutorial
to help you get started with rails.
I think this command will work or you are missing something which is required to run rails server
bin/rails server
I've got similar error when I am not in rails project directory. Seems you are out of directory.
Please run those full commands in powershell
cd c:/
rails new testapp
cd testapp
rails s

docker-compose is creating files with permission

I'm using docker-compose as my development environment for my rails application so I don't need to install the future requirements on my own computer. The problem is that when I run, for example, docker-compose run app rails g migration FooBar, the migration file is created with permission so that I can't edit it without permission, and for me this is a problem, I wish this did not happen.
I understand why this occurs and this is not under discussion, what I want is know if I can create my files through docker-compose without permission to access it.
I don't know if I'm using the docker-compose in a wrong way, I'm a beginner with docker and maybe what I'm wanting to do don't make sense, if that's case could someone tell me how I could proceed to run my rails application and execute rails commands with docker.

Error: Rails command not found

I created a new Rails project in a directory, say Desktop (rails new project1). After that, I ran the following command:
rails server
Then, the project1 was running on localhost.
After that, I made another directory with name (project1) in another location. I copied all the files from the previous location to new location. After that, when I ran the following command:
rails server
I got the following error message:
Rails is not currently installed on this system.
But it is working in the previous directory. How do I solve this?
If you are totally new to Rails development and System administration it is rather complicated in the beginning. I recommend any kind of Rails tutorial to you for examply by Michael Hartl .
As Graeme McLean points out you somewhen understand that there is information about your environment needed to help you.
Most likely the requirements you need to be set up are not set up in the place you did copy your rails project as Pavan and Thaha kp pointed out.

Cannot start project in rails

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.

cannot run rails server command for already created project

I have got an application which was zipped and I unzipped the files and it gave me a folder with all the required structure of a rails application. But when I am going inside the directory and running the rails server command, its not doing anything, but showing me the list of options rails command can do. What would have been the problem?
thanks
Maybe this will help from app folder try:
ruby script/rails server
As explained by Dave Isaacs, Showing the list of options is what the rails command does when it is executed outside the context of an application (i.e., not in the application directories).
Type the full command, including the /script path to the CLI.
script/rails server
instead of
rails server
where script is the path to the rails command that, in a Rails 3 application, lives in the script folder.
I would assume that the application you got was written with rails 2.x. In that case, you have to start it with
script/server

Resources