The city is believed to be of Roman origin, in view of the number of amphoras and writings that have been found, although the city was reportedly founded 986 with the name of Rivo Rubeo. At the death of Wilfred the Hairy, the border between Al-Andalus and Catalan counties was delimited by the river Llobregat, with Catalans to the north and Muslims to the south; Rubí was therefore very close to the border. In 1233, Berenguer de Rubí asked the king Jaume I to build a new castle, which is now the Ecomuseu Castell de Rubí, a museum about the town. With the Industrial Revolution, the town's population grew dramatically, with the decline of agriculture and the growth of textile industries near the Riera de Rubí. Some of the early mills still exist. In 1919 Rubí was connected to Barcelona and Terrassa by railway and the new, rich bourgeoisie built modernista-style buildings such as the Escoles Ribas and Torre Bassas. The Celler Cooperatiu was built during the period of the Commonwealth of Catalonia and the dominance of the cooperativism in agriculture. Industry developed very quickly and now many different kinds of industries are located in Rubí, ranging from textile manufacturing to electronics and chemical products. Some of these factories have been closed in recent years to move to China or eastern countries. Rubí lost most of its agriculture in 1962, when disastrous flooding destroyed the lowest part of the town and affected the cities near the Riera de Rubí. Those floods are considered to have been the worst such catastrophe to have occurred in Spain. Since the 1990s, Rubí has been receiving a new wave of immigration from South America and North Africa.
Economy
The population of Rubí is currently growing due to immigration and the movement of population from Barcelona city because of the high housing prices there. Most of the population works in services sector, basically in minor commerce. Industry is still a very important sector, although the unemployment rate is higher than the provincial average.
Main sights
Castle
Celler Cooperatiu, a Modernist building constructed in 1920-1921
Rubí has eleven public elementary schools : CEIP 25 de Setembre, CEIP Ca n'Alzamora, CEIP Joan Maragall, CEIP Maria Montessori, CEIP Mossèn Cinto Verdaguer, CEIP Pau Casals, CEIP Ramon Llull, CEIP Rivo Rubeo, CEIP Schola, CEIP Teresa Altet and CEIP Torre de la Llebre. The town has four public middle schools : 'IES Duc de Montblanc, IES J. V. Foix, IES L'Estatut and IES La Serreta. It also has the private schools of Regina, Ribas, Nostra Senyora de Montserrat, Balmes and Escola Maristes de Rubí.
Health
Rubí has three health centers : CAP1 Mútua de Terrassa, CAP2 Anton de Borja and CAP3 Sant Genís. In addition, there is the Ferran Salsas i Roig Health Orientation Center and a mental health day center. A new hospital is being planned in Can Sant Joan.
Sport
The In-line hockey club, Cent Patins Rubí, was founded in 1992 during the Olympic Games in Barcelona. The club is playing at national and European level. The professional team has won the European Cup Championships 2009 and two national titles the seasons 2005/06 and 2008/09. The football team now is playing in the third division of Spain, the team was founded in 1912.
Transportation
The municipality of Rubí is situated near one of Catalonia's main communications hubs. Its public transport lines are included in the integrated fare system of Barcelona, under the aegis of the Autoritat del Transport Metropolità.
Railway
Both the main railway companies that operate in Catalonia have stations in Rubí. Ferrocarrils de la Generalitat de Catalunya's lines, known as "Metro del Vallès", join Barcelona with Terrassa and Sabadell. Lines S1 and S5 serve Rubí. Renfe Rodalies Barcelona opened a new station in Rubí a few years ago. Line R7 serves Rubi's RENFE station and joins Martorell with Barcelona.