I have installed:
Ubuntu 12.10
jruby 1.7.3
ruby 2
rails 3.2.13
RubyMine 5
DB2 C-Express
I have create a sample application and connected it correctly to the database - I know this because I have successfully executed the scaffold and migrate commands and check that the tables are created.
Then I have run the following commands in order to deploy my application with torquebox 2.0:
torquebox deploy
torquebox run
I have run these commands in my project folder and as a result on localhost:8080 I am seeing rails start page. I have the following issues:
Clicking on "About your application’s environment" tab I am getting the following error:
javax.servlet.ServletException: org.jruby.exceptions.RaiseException:
(NameError) cannot link Java class com.ibm.db2.jcc.DB2Driver, probable
missing dependency: Could not initialize class
com.ibm.db2.jcc.DB2Driver
org.torquebox.web.servlet.RackFilter.doRack(RackFilter.java:117)
org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:101)
org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:72)
org.torquebox.web.servlet.SendfileFilter.doFilter(SendfileFilter.java:49)
org.torquebox.web.servlet.SendfileFilter.doFilter(SendfileFilter.java:33)
I believe this is because the torque box is not able to find the driver. But why as it is vissible in my rails application and I successfully created/migrate tables from it using the terminal? Should I put the driver somewhere else,too?
Then I the torque box documentation is said:
Changes to your Rails application show up immediately in the browser,
as expected. When you're done, press CTRL+C in the terminal to stop
TorqueBox before continuing with the next steps.
But that's exactly what I have had to do in order to refresh the content of the page. I have changed my gem file and database.yml file but refreshing the page did not reflect this. After I have stop the server and start it again it shows something different.
Could you advise or tell me what I am doing wrong?
Without restarting the Torquebox server your can redeploy the knob with touch just run
touch $TORQUEBOX_HOME/jboss/standalone/deployments/your_apps-knob.yml.deployed
this way you don't have to restart whole JBOSS server.Deployment via descriptor
For production setups you can use Capistrano Torquebox Capistrano support
Related
I tried to complete the first suggestion by typing
ruby
rails bin/dev
but I was not able to get an output (The terminal showed no output )
then I realized my code was wrong so I tried once again and typed:
rails create bin/dev
But it showed me an error and said "rails aborted!
Don't know how to build task 'create' (See the list of available tasks with rails --tasks)
Did you mean? db:create"
Then I tried the other command by typing rails in front of it but that didn't work either.
So even though my app works should I bother to solve this warning or skip past it?
TLDR: You need to build your CSS output on every Tailwind style addition so execute bin/dev in a terminal to start your rails server AND watch for tailwind changes.
Hey! Your screenshot is saying that you have successfully installed Tailwind via the tailwind-rails gem.
The end of the message provides instructions on how to build your Tailwind CSS during local development so that Tailwind styles are output to the CSS and applied to your app on localhost:3000 immediately.
Option 1: (documented in the installation output) In your terminal, execute bin/dev to start your rails server AND watch for tailwind changes. This command uses a library called foreman to run two processes, reading from the Procfile.dev that was created in your project's root directory during tailwind installation.
Option 2: (documented in this section of the README) In your terminal, execute rails s in one terminal window and rails tailwindcss:watch in a different window (separate commands)
Option 1 is simpler and probably recommended.
(Based on your screenshot, you are not on a Mac and your exact command may differ, but these work for me on a macbookpro.)
I have a complete ruby project on my system that I downloaded from github.com and I want to run it on my Windows machine.
I have already installed Ruby and Rails on my system, but I have no idea how to run this project. The directory of this project is something like:
C:\Users\{username}\Desktop\BitcoinFundi\BitcoinFundi
How would I run this project on my system?
To run your Ruby on Rails application, use the following command:
rails server
This will start the server and you will be able to access the application in your browser at http://localhost:3000. Port 3000 is default and you can change it in the application settings.
To run a Ruby script use:
ruby name_of_script.rb
You should check out various resources and tutorials on getting started with rails.
As you say in your comment this is your first experience with Ruby on Rails, I think you should follow through chapter 1 and 2 (at least) of Ruby on Rails Tutorial. After that you should have a better understanding of how you start up a rails app and configure the DB. You also need a bunch of other libraries and software such as mysql from the sounds of it.
You should also read Getting Started with Rails. Section 4 covers how to start the default rails server.
Here is a guide on setting up a Rails environment for Windows, which is one of many guides, that shows you some of the needed steps to get a fully working environment.
I am a beginner.I am trying to launch rails server using the command.But I am getting an error. I tried searching in the google but no results.I will attach a picture of the log I got when I executed that command.
What Mysql error are you getting?
And what is in your config/database.yml?
So far, you have created the folder structure for a Rails app (rails new), then installed all the relevant components (bundle install).
When you start the server (rails server) it starts in "development" mode (you also have "test" mode for unit tests and "production" mode for when your app is live - and each has slightly different options). One of the first things the Rails server tries to do is connect to the database, so it looks in config/database.yml for the database specified in the development section.
So probably, it's trying to connect to a database that doesn't exist yet, with a username and password that are wrong.
First thing to do is to update the username and password in config/database.yml to match your local Mysql server.
Second thing to do is to build the development database; the command for that is "bin/rake db:create" (or "bundle exec rake db:create" if you're on Rails 3.x).
Hopefully that should be enough to get your server started.
How did you setup your rails app?
It seems like maybe you didn't type
bundle install
This command downloads and updates all of your gems. Action View is a rails dependency.
I have use the instant rails. In ruby console window I have created a new ruby rails application but I can't run the file server from the script folder.
To run it i used script/server command. it says "server" is not recognized internal or external command.
I am not running windows as administration
I personally don't know what your environment looks like but it looks like instant rails isn't maintained anymore (discontinued in 2007).
That being said it might be that you're not running the script using a Ruby executable.
I would personally suggest switching to RailsInstaller or RubyStack.
I don't want to keep sphinx running all the time on my dev machine. I'd like a way to automatically execute rake thinking_sphinx:start when I run my app via netbeans. Is there a way to do this
[also - I am using Windows]
Thinking sphinx needs to run as a separate process.
You will need a third-party program called PsExec to do this. Otherwise you won't be able to start a background process using Ruby on Windows.
First of all download PsExec here. Unpack (at least) psexec.exe and run it once manually - you have to agree to the license :-/.
After that add the following line to script/server of your Rails app:
system 'PATH_TO_PSEXEC/psexec -d rake.bat'
Now you create the rake.bat with the commands to run in parallel to your server. Put the file with the following contents into your Rails app's root directory.
rake thinking_sphinx:start
This line should do the trick, but it may fail e.g. when NetBeans' JRuby version differs from Ruby installed on your host. Or if Ruby isn't installed at all. In that case you should call rake with the complete path of JRuby:
"PATH_TO_NETBEANS/ruby2/jruby-1.2.0/bin/jruby" "PATH_TO_NETBEANS/ruby2/jruby-1.2.0/bin/rake" thinking_sphinx:start
When you start the server now, an additional Windows command-line pops up with the running rake task.
Needless to say that you shouldn't add the code to script/server on your production server.