I tried the rails site_name command to create a rails application. The command says that the usage is rails new APP_PATH[options]
I tried the rails new site_name command.
I dont get any server file inside my site_name/script folder to run the application.
why is this happening?
Use
$ rails server
to start the server. In general with Rails 3, any command you would have previously run with ./script/... you now run with rails ...
Related
I'm not to ruby on rails, and I'm setting up my first application, according to a textbook (Ruby 4 in Rails). No action is triggered, When typing the command:
$ rails generate scaffold purchase name:string cost:decimal
Can anyone help me resolved this?
I installed Ruby and Rails, newest versions and then did the following steps before typing the mentioned command.
$ rails new things_i_bought
$ cd things_i_bought
$ rails server
When you do
$ rails server
You're starting the server. You don't to want do that when working from the command line.
Hit Ctrl-C to stop the server, then run your scaffold command.
I am experiencing some weird rails behaviour:
When I do the following commands
rails new blog
rails s
rails server
The result for each is a new project, that is 3 folders names new, s, server, all with a new rails project in them
...why is this happening?? I have a feeling it may have to do with the versions I am using, I used rvm to update from 1.87 to 2.0 for Ruby and I just installed rails 2.3.14
I am using xubuntu which also just switched from Unity.
It looks like you are trying to use a Rails 3.x command with Rails 2.3. Pre 3.0 you have to use the server script.
From within your application directory run:
./script/server
Hope this helps.
I have installed ruby193 and I've installed rails via the command prompt. However, whenever I try the command:
ruby script/server
I get this error:
ruby: No such file or directory -- script/server (LoadError)
I checked my script folder and all it has is a file called rails.
I'm very new to Ruby on Rails and I'm not entirely sure if I've installed everything correctly. Is there an easy way to check what I have installed?
To clarify on the existing answers, ruby script/server is no longer the proper way to start a server in Rails. In Rails 3, we use rails server, which can be shortened to rails s. See the Rails Guides for a more extensive rundown of the Rails 3 command line interface.
Try running rails server or rails s.
If you have Ruby & rails installed properly, then ruby -v would result in the version that you have installed and likewise rails -v would give the rails version installed.
To run a rails server try running rails server or rails s
I'm trying to get RoR installed on my Ubuntu install and have it running with MySql. RoR and MySql have both installed fine and working but I'm having problems getting rails to work with MySql following this tutorial: http://wiki.rubyonrails.org/getting-started/installation/linux
To test your Rails installation, generate a new Rails project:
$ rails myrailsapp
If you are using MySQL, use the following command:
$ rails myrailsapp -d mysql
Now I know that you now have to type rails new [appname] not just rails [appname] to get this working once this is done and project is created its still using the sqlite3 databse so I run the next line $ rails myrailsapp -d mysql when I do this I just get a large list of text giving me various options with out changing anything.
What have I done wrong?
You actually want to generate the project with the -d specifier, not apply it to your project after generation. Start a new project like this:
rails new myrailsapp -d mysql
You need to enter just one command:
rails new railsappname -d mysql
It will create a rails app with mysql configuration.
Welcome aboard #twigg to the Rails world =).
First of all, you have to specify your Rails version you installed. If your Rails version < 3 then you can create a new project by simply running the command rails my_app_name. If you are using Rails > 3 then to create a new project just run the following command rails new my_app_name. This command will create a bunch of files one of them is the database.yml where you can configure you database parameters (adapter, username, password and database name).
If you are using Rails with MySQL, then to create a project configured with MySQL, just run the command rails my_app_name -d mysql in Rails < 3 or rails new my_app_name -d mysql
Don't forget to install the adapter of the database which is in your case (MySQL) ruby-mysql by running the command gem install ruby-mysql
I installed rails 3 beta in my OSX Leopard. After that, I've created a rails project to test it. From inside its folder, I just can't do script/generate, or even script/server.
It returns '-bash: script/server: No such file or directory'. How could I resolve this issue?
Rails 3 has done away with script/*. Use rails server, rails generate, etc. while in your app's directory.
Run rails --help to get the full list.
In Rails 3, instead of using script/*, use rails. So instead of writing script/generate use rails g (alias of generate) and instead of script/server use rails s (alias of server).
The additional usage of port/environment is the same as in Rails 2. So you can add the port 3005 (default is 3000) with production environment as rails s -p 3005 -e production. Hope that will solve your problem.